Skip to content

Axes.autoscale has scale-inconsistent margins #16539

Closed

Description

@scottgigante

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.)

Activity

  1. ImportanceOfBeingErnest commented on Feb 16, 2020

    @ImportanceOfBeingErnest
    Member

    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.

  2. scottgigante commented on Feb 17, 2020

    @scottgigante
    Author

    Thanks, and apologies for the noise!

  3. tacaswell commented on Feb 18, 2020

    @tacaswell
    Member

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

  4. added this to the v3.2.0 milestone on Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions