Skip to content

autoscale differences between 1.5.1 and 2.0.0b3 #6968

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
LevN0 opened this issue Aug 23, 2016 · 3 comments
Closed

autoscale differences between 1.5.1 and 2.0.0b3 #6968

LevN0 opened this issue Aug 23, 2016 · 3 comments
Assignees
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@LevN0
Copy link
Contributor

LevN0 commented Aug 23, 2016

Based on description of tight ("If True, set view limits to data limits"), I would have expected MPL 1.5.1 behavior (see code and image below). Though perhaps there was a little margin added intentionally?

Edit: I see this first part was intended, as change #5583. See second issue below.

import matplotlib as mpl

plt.plot([1,2,3,4])
plt.autoscale(axis='both', tight=True)

plt.show()

limits_tight


Aside from this, MPL 1.x use to conveniently adjust view limits for log and symlog when tight autoscaling was not on, but MPL 2 does not seem to do this anymore.

This actually also looks like a result of #5583. I would argue the previous behavior was actually desirable in many instances. Is there a way to recover it?

import matplotlib as mpl

plt.plot([1,2,3,4])

ax = plt.gca()
ax.set_xscale('log')
ax.set_yscale('log')

plt.show()

log_scaling

Python 2.7 and 3.4
Using tkagg backend.
Windows 7

@LevN0 LevN0 changed the title autoscale differences between 1.5.2 and 2.0.0b3 autoscale differences between 1.5.1 and 2.0.0b3 Aug 23, 2016
@tacaswell tacaswell added this to the 2.0 (style change major release) milestone Aug 23, 2016
jenshnielsen added a commit to jenshnielsen/matplotlib that referenced this issue Sep 4, 2016
jenshnielsen added a commit to jenshnielsen/matplotlib that referenced this issue Sep 4, 2016
@jenshnielsen jenshnielsen self-assigned this Sep 4, 2016
jenshnielsen added a commit to jenshnielsen/matplotlib that referenced this issue Sep 4, 2016
@NelleV NelleV added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. and removed status: needs review labels Nov 11, 2016
@efiring
Copy link
Member

efiring commented Nov 13, 2016

@LevN0 in answer to your question, with v2.x if you start with mpl.style.use('classic') you will get the same autoscaling as with 1.5. You can also use a context manager, or you can just set the relevant rcParams:

mpl.rcParams['axes.autolimit_mode'] = 'round_numbers'
mpl.rcParams['axes.xmargin'] = 0
mpl.rcParams['axes.ymargin'] = 0

efiring added a commit to efiring/matplotlib that referenced this issue Nov 14, 2016
dopplershift added a commit that referenced this issue Nov 14, 2016
[MRG+1] BUG: make autoscale('tight') set margins to zero; closes #6968
@NelleV
Copy link
Member

NelleV commented Nov 14, 2016

Closed in #7458

@NelleV NelleV closed this as completed Nov 14, 2016
@LevN0
Copy link
Contributor Author

LevN0 commented Nov 14, 2016

@efiring Thank you. I tried axes.autolimit_mode and it seems to result in the MPL 1.5 behavior for that aspect recovered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

No branches or pull requests

5 participants