October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block plots a polar plot and histogram on two axes within the same figure. It then saves each plot separately to demonstrate saving part of the figure, instead of the full figure:
np.random.seed(19681211)plt.figure(figsize=(8, 6))
N = 250r = 10 * np.random.rand(N)theta = 2 * np.pi * np.random.rand(N)area = r**2 colors = theta
ax1 = plt.subplot(121, projection='polar')ax1.scatter(theta, r, c=colors, s=area, cmap='plasma', alpha=0.6)ax1.set_title('Polar Plot', color='m', size=15, weight='bold')
ax2 = plt.subplot(122)nd = np.random.normal(25, ...
Read now
Unlock full access