Skip to content
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

Stackplot fails for small numbers #17633

Closed
svaberg opened this issue Jun 15, 2020 · 1 comment · Fixed by #17635
Closed

Stackplot fails for small numbers #17633

svaberg opened this issue Jun 15, 2020 · 1 comment · Fixed by #17635

Comments

@svaberg
Copy link

svaberg commented Jun 15, 2020

Bug report

Bug summary

It appears that stackplot fails for small numbers in version 3.2.1, or at least something goes wrong in my clean installation, see figures below.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt

x =  [0, 1]
y1 = 1e-8*np.ones_like(x)
y2 = 1e-9*np.ones_like(x)

fig, axs = plt.subplots(2, 1)
axs[0].stackplot(x, y1, y2)  # This plot is fine
axs[1].stackplot(x, y1/10, y2/10)  # This plot is wrong
plt.show()

Actual outcome
image
Something went wrong in the second subplot.

Expected outcome
Expected this, as generated with matplotlib version 3.1.2
mpl312

Matplotlib version

  • Operating system: macOS 10.12.6 (Sierra)
  • Matplotlib version: 3.2.1
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.8.3

Created a conda environment with only thenumpy package, then installed matplotlib with pip.

@jklymak
Copy link
Member

jklymak commented Jun 15, 2020

Bisects to 0911f8a, #13980 ping @anntzer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants