Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Repeated calls to scatter with identical data produce different axis limits #15955

Copy link
Copy link
Closed
@mwaskom

Description

@mwaskom
Issue body actions

Bug report

Bug summary

In trying to debug some tests, I discovered some strange behavior. I'm not certain it's a bug, but I can't really think of an explanation for it, so I'm reporting.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt

f, ax = plt.subplots()
x, y = np.random.randn(2, 50)
ax.scatter(x, y)
xlim = ax.get_xlim()
ax.scatter(x, y)
print(xlim == ax.get_xlim())

Actual outcome

False

Expected outcome

True

Other observations

It appears to be scatter dependent. If I replace both calls to scatter with plot, it passes. Calling scatter then plot passes, but calling plot then scatter fails.

Matplotlib version

  • Operating system: MacOS
  • Matplotlib version: '3.1.1'
  • Matplotlib backend (print(matplotlib.get_backend())): notebook inline, reproduces on Agg
  • Python version: 3.7

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.