Skip to content

Instantly share code, notes, and snippets.

@williamtellme123
williamtellme123 / gist:688d3b048a160602f11cb9f06fca97d7
Created June 3, 2021 19:37
Anatomy of A Figure: State-Based
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
np.random.seed(19680801)
X = np.linspace(0.5, 3.5, 100)
Y1 = 3 + np.cos(X)
Y2 = 1 + np.cos(1 + X / 0.75) / 2
Y3 = np.random.uniform(Y1, Y2, len(X))
@williamtellme123
williamtellme123 / gist:413e5e9949f00be2ae95b97b8a9c4fff
Created June 3, 2021 19:33
Anatomy of a Figure : Object-Oriented
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator, MultipleLocator
np.random.seed(19680801)
X = np.linspace(0.5, 3.5, 100)
Y1 = 3+np.cos(X)
Y2 = 1+np.cos(1+X/0.75)/2
Y3 = np.random.uniform(Y1, Y2, len(X))