This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stylesheet for matplotlib | |
# | |
# Author: Nicolas Guarin-Zapata | |
# Date: September, 2018 | |
### Math Text | |
mathtext.fontset : cm | |
### Text | |
text.color : 757575 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Generate a dragon curve | |
@author: Nicolás Guarín-Zapata | |
@date: July 2024 | |
""" | |
import os | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.integrate import trapezoid, simpson, quad | |
repo = "https://raw.githubusercontent.com/nicoguaro/matplotlib_styles/master" | |
style = repo + "/styles/clean.mplstyle" | |
plt.style.use(style) | |
plt.rcParams["font.size"] = 20 | |
plt.rcParams["lines.linewidth"] = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Flip a fair coin 100 times—it gives a sequence of heads (H) | |
and tails (T). For each HH in the sequence of flips, Alice | |
gets a point; for each HT, Bob does, so e.g. for the | |
sequence THHHT Alice gets 2 points and Bob gets 1 point. | |
Who is most likely to win? | |
https://x.com/littmath/status/1769044719034647001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ori-py | |
channels: | |
- conda-forge | |
dependencies: | |
- python | |
- numpy | |
- scipy | |
- matplotlib | |
- jupyterlab | |
- pyvista |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.polynomial import Polynomial | |
rng = np.random.default_rng() | |
x = np.arange(10) | |
y = np.arange(10) + 0.01*rng.standard_normal(10) | |
p_fitted = np.polynomial.Polynomial.fit(x, y, deg=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import matplotlib.pyplot as plt | |
from wordcloud import WordCloud, STOPWORDS | |
#%% | |
f = open('output_file.txt', 'r', encoding="utf8") | |
text = f.read() | |
f.close() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from skimage import measure | |
y, x, z = np.mgrid[-2:2:100j, -2:2:100j, -2:2:100j] | |
f = (x**2 + 9/4*y**2 + z**2 - 1)**3 - x**2 * z**3 - 9/80*y**2*z**3 | |
verts, faces, _, _ = measure.marching_cubes(f, 0, spacing=(0.1, 0.1, 0.1)) | |
fig = plt.figure() |
NewerOlder