[Matplotlib-users] How to apply ax.margins to current axes limits?

Jack Yu llacque at gmail.com
Thu Nov 3 22:38:47 EDT 2016

Is there a way to use ax.margins to adjust the axes limits, after the axes
limits have already been adjusted using ax.set_ylim? It appears that
ax.margins has effect only if ax.set_ylim has not been used.

This notebook

describes a situation in which this need may arise.

Note: the y-axis is just an example, the same also applies to the x-axis (
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20161104/e54fbc2e/attachment.html>

More information about the Matplotlib-users mailing list