October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block displays six plots with the same data, but with different options for spines:
theta = np.linspace(0, 2*np.pi, 128)y = np.sin(theta)
fig = plt.figure(figsize=(8,6))
ax1 = fig.add_subplot(2, 3, 1)ax1.plot(theta, np.sin(theta), 'b-*')ax1.set_title('default spines')
def plot_graph(axs, title, lposition, bposition): ax = fig.add_subplot(axs) ax.plot(theta, y, 'b-*') ax.set_title(title) ax.spines['left'].set_position(lposition) ax.spines['right'].set_visible(False) ax.spines['bottom'].set_position(bposition) ax.spines['top'].set_visible(False) ...
Read now
Unlock full access