October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block plots four graphs and saves them in a .png format:
np.random.seed(19681211)
N = 250r = np.random.rand(N)theta = 2 * np.pi * np.random.rand(N)area = 500 * r**2colors = theta
plt.figure(figsize=(6,4))ax = plt.subplot(111, projection='polar')c = ax.scatter(theta, r, c=colors, s=area, cmap='plasma', alpha=0.6)plt.title('Polar Plot', color='m', size=15, weight='bold')
plt.savefig('polar_transparent.png', dpi=300, transparent=True)plt.show()
Read now
Unlock full access