October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block plots a histogram and saves two different dpi parameters for comparison:
np.random.seed(19681211)nd = np.random.normal(25, 5, 10000)
plt.figure(figsize=(6,4))plt.hist(nd)
plt.grid()
plt.savefig('histogram_300.png', dpi=300)plt.show()
plt.figure(figsize=(18,12))plt.hist(nd)plt.grid()plt.savefig('histogram_100.png', dpi=100)plt.show()
Read now
Unlock full access