Skip to content

axes.xmargin/ymargin rcParam behaves differently than pyplot.margins() #2298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
funnell opened this issue Aug 15, 2013 · 6 comments · Fixed by #19511
Closed

axes.xmargin/ymargin rcParam behaves differently than pyplot.margins() #2298

funnell opened this issue Aug 15, 2013 · 6 comments · Fixed by #19511

Comments

@funnell
Copy link

funnell commented Aug 15, 2013

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?

@tacaswell
Copy link
Member

@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
Copy link
Member

efiring commented 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
Copy link
Member

Punting to 1.4.x

@tacaswell tacaswell modified the milestones: v1.4.x, v1.4.0 May 13, 2014
@pelson
Copy link
Member

pelson commented May 20, 2014

Punting to 1.4.x

Did you mean that, or was that meant to be 1.5?

@tacaswell
Copy link
Member

yup, should have been 1.5 (didn't read my own earlier comments).

@tacaswell tacaswell modified the milestones: v1.5.x, v1.4.x May 20, 2014
@petehuang
Copy link
Contributor

Hi,

This issue has been inactive for a while. What is the latest discussion / development for this topic? Thanks!

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@QuLogic QuLogic modified the milestones: needs sorting, v3.4.0 Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants