Second y-axis label getting cut off
Solution 1:
I just figured it out: the trick is to use bbox_inches='tight'
in savefig
.
E.G. plt.savefig("test.png",bbox_inches='tight')
Solution 2:
I encountered the same issue which plt.tight_layout()
did not automatically solve.
Instead, I used the labelpad argument in ylabel
/set_ylabel
as such:
ax.set_ylabel('label here', rotation=270, color='k', labelpad=15)
I guess this was not implemented when you asked this question, but as it's the top result on google, hopefully it can help users of the current matplotlib version.