October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block plots a histogram and saves it in all Matplotlib-supported formats:
np.random.seed(19681211)plt.figure(figsize=(6,4))
nd = np.random.normal(25, 5, 10000)plt.hist(nd)plt.ylabel('histogram')
file_ext = ['png', 'pdf', 'svg', 'svgz','eps','ps']
for extension in file_ext: print('saving Histogram.%s ' % (extension)) plt.savefig('Histogram.%s' % (extension), dpi=300)plt.show()
Read now
Unlock full access