UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. warnings.warn("This figure includes Axes that are not compatible " code example
Example: axes not compatible with matplotlib pdf
# Give bbox_inches='tight' as argument in savefig
plt.savefig('fig.png',bbox_inches='tight')