Skip to content

Correct setup of margins for logarithmic plots - #2263

Closed
mowa-lepota wants to merge 3 commits into
matplotlib:masterfrom
mowa-lepota:master
Closed

mowa-lepota wants to merge 3 commits into
matplotlib:masterfrom
mowa-lepota:master

Conversation

@mowa-lepota

Copy link
Copy Markdown

The current formula for setting margins is false in case of log plots. Here is a tested suggestion handling the special case. Please see if this can be backported to the current release candidate (perhaps even beyond), as it seems mandatory to have a correct way of setting margins for log plots.

@WeatherGod

Copy link
Copy Markdown
Member

My concern about this code is that this would produce different results depending on whether the log scaling was set before or after the plotting command. Now, that is more an indictment against how we handle autoscaling rather than your code and so it probably shouldn't be a reason against including this.

Note that you would most likely need to update test images, and if this change doesn't break any test images, then tests need to be added.

@WeatherGod

Copy link
Copy Markdown
Member

Also, perhaps we should think about delegating the responsibility of determining such autoscaling over to the scales rather than what could potentially become a huge if/elif/else statement if more scales are supported.

@mdboom

mdboom commented Jul 31, 2013

Copy link
Copy Markdown
Member

The domain of the axis is already determined by the scale's locator -- see the call to xlocator.view_limits right where this change is here. We should fix it in the LogLocator, and also have the locator used even for tight bounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants