Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plt.show shows full graph but savefig is cropping the image

You may try

plt.savefig('X:/' + newName + '.png', bbox_inches='tight')

Or you may define figure size like

fig = plt.figure(figsize=(9, 11))
...
plt.savefig(filename, bbox_inches = 'tight')

As described in the documentation you may also try:

plt.tight_layout()