You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
axes.xmargin/ymargin rcParam behaves differently than pyplot.margins() #2298
When setting the axes.xmargin paramter in my matplotlibrc file to say, 0.05, the margins are increased by much more than 0.05. If I adjust the margins using pyplot.margins(0.05) then I see the expected behaviour.
This seems to be related to the 'tight' parameter in the margins function as setting tight=False reproduces the behaviour of setting the axes.xmargin rcParam.
I suggest having the axes.xmargin/ymargin rcParams behave the same way as the default behaviour of pyplot.margins by having autoscale(tight=True) be run when setting these rcParams. Otherwise, perhaps an autoscale rcParam might be useful?
@funnell Sorry it took so long for anyone to respond to this. Your comments are exactly right.
Changing the behavior of the rcparam seems like an api break, but we are about to release 1.4 and this is probably minor enough to be ok. Adding yet another rcparam would get around that problem, but adds yet another rcparam. I am leaning towards adding axes.margin_autoscale.
Even though this seems like a small thing, we need to come up with a reasonable array of alternatives. What values would axes.margin_autoscale take, and how would its effect be implemented?
All this is complicated by the fact that Axes has a single _tight attribute rather than a _tight_x and a _tight_y, and there are many "autoscale*" attributes and methods--it can get confusing, fast. So I agree that something needs to be done, but I suspect that doing it well will require considerable thought and work.
Activity
tacaswell commentedon Apr 3, 2014
@funnell Sorry it took so long for anyone to respond to this. Your comments are exactly right.
Changing the behavior of the rcparam seems like an api break, but we are about to release 1.4 and this is probably minor enough to be ok. Adding yet another rcparam would get around that problem, but adds yet another rcparam. I am leaning towards adding
axes.margin_autoscale.Anyone else have thoughts?
efiring commentedon Apr 3, 2014
Even though this seems like a small thing, we need to come up with a reasonable array of alternatives. What values would axes.margin_autoscale take, and how would its effect be implemented?
All this is complicated by the fact that Axes has a single _tight attribute rather than a _tight_x and a _tight_y, and there are many "autoscale*" attributes and methods--it can get confusing, fast. So I agree that something needs to be done, but I suspect that doing it well will require considerable thought and work.
tacaswell commentedon May 13, 2014
Punting to 1.4.x
pelson commentedon May 20, 2014
Did you mean that, or was that meant to be 1.5?
tacaswell commentedon May 20, 2014
yup, should have been 1.5 (didn't read my own earlier comments).
petehuang commentedon Dec 29, 2016
Hi,
This issue has been inactive for a while. What is the latest discussion / development for this topic? Thanks!