Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
Path = mpath.Path
fig, ax = plt.subplots()
pp1 = mpatches.PathPatch(
Path([(0, 0), (1, 0), (1, 1)],
[Path.MOVETO, Path.CURVE3, Path.CURVE3]),
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["font.size"] = 14
# change theta
N = 20
theta = np.linspace(0, 2*np.pi, N, endpoint=False)
radii = 10 * np.ones(N)
width = np.pi / N
colors = plt.cm.magma(theta / (2*np.pi))
import matplotlib.animation as animation
from IPython.display import HTML
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 1, 0.01)
theta = 2 * np.pi * r
fig = plt.figure(figsize=(5,5))
ax = plt.subplot(111, projection='polar')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#Stackplot
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["font.size"] = 14
x = np.arange(6)
y1 = np.random.randint(1,5,6)
y2 = np.random.randint(1,5,6)
y3 = np.random.randint(1,5,6)
labels = ["sa ", "bo", "py"]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import matplotlib.pyplot as plt
n = 120000
x = np.random.standard_normal(n)
y = np.random.standard_normal(n)
xmin = x.min()
xmax = x.max()
ymin = y.min()
ymax = y.max()