October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block plots a histogram and saves it with the default parameters, using the bbox_inches='tight' parameter, followed by the addition of pad_inches=1:
np.random.seed(19681211)plt.figure(figsize=(6,4))
nd = np.random.normal(25, 5, 10000)plt.hist(nd)plt.ylabel('histogram', labelpad=20)
file_ext = ['png', 'pdf', 'svg', 'svgz','eps','ps']
for extension in file_ext: print('saving ...Read now
Unlock full access