Skip to content

Axes.autoscale has scale-inconsistent margins #16539

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
scottgigante opened this issue Feb 16, 2020 · 3 comments
Closed

Axes.autoscale has scale-inconsistent margins #16539

scottgigante opened this issue Feb 16, 2020 · 3 comments
Milestone

Comments

@scottgigante
Copy link

Bug report

Bug summary

Autoscaling axis behaviour is inconsistent for data on very small scales

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np
x = np.repeat(np.arange(10), 10)
y = np.tile(np.arange(10), 10)

fig, axes = plt.subplots(1, 4, figsize=(16, 4))
axes[0].scatter(x, y)
axes[1].scatter(x*1e3, y*1e3)
axes[2].scatter(x*1e-3, y*1e-3)
axes[3].scatter(x*1e-6, y*1e-6)
plt.show()

Actual outcome

image

Expected outcome

The plot should scale in the same way regardless of absolute values of data range. E.g.

image

Matplotlib version

  • Operating system: Arch Linux
  • Matplotlib version: 3.0.3
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.8.1
  • Jupyter version (if applicable): jupyter-client==5.3.4 jupyter-console==6.0.0 jupyter-core==4.6.1

Installed with pacman on arch linux (installs from source.)

@ImportanceOfBeingErnest
Copy link
Member

ImportanceOfBeingErnest commented Feb 16, 2020

Thanks for the bug report. This is one of the points tracked in #7413. This part is fixed in current master by #13642. You can try the release candidate of matplotlib 3.2 to see it in action.

@scottgigante
Copy link
Author

Thanks, and apologies for the noise!

@tacaswell
Copy link
Member

@scottgigante Better a bit of noise than bugs going un-reported.

@QuLogic QuLogic added this to the v3.2.0 milestone Jun 16, 2020
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

No branches or pull requests

4 participants