8000 Surprising/changed axis limit (autoscale) behavior · Issue #17331 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Surprising/changed axis limit (autoscale) behavior #17331
Closed
@mwaskom

Description

@mwaskom

Bug report

Bug summary

The interaction of setting axis limits and autoscaling changed in 3.2 with little guidance, introducing unexpected behavior that doesn't always make sense.

Code for reproduction

Here is a plot that looks very different on 3.1.2 and 3.2.1

import numpy as np
import matplotlib.pyplot as plt
f, ax = plt.subplots()
x = np.arange(100)
y = np.random.uniform(-.1, .1, 100)
ax.scatter(x, y)
assert ax._autoscaleYon
ax.set_ylim((-.5, .5), auto=None)

Actual outcome

On 3.2.1

image

Expected outcome

On 3.1.2

image

Matplotlib version

  • Operating system: macOS
  • Matplotlib version: 3.2.1
  • Matplotlib backend (print(matplotlib.get_backend())): pylab inline
  • Python version: 3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0