Skip to content

Stackplot fails for small numbers #17633

Closed

Description

@svaberg

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.

Activity

  1. jklymak commented on Jun 15, 2020

    @jklymak
    Member

    Bisects to 0911f8a, #13980 ping @anntzer

  2. added this to the v3.4.0 milestone on Jun 15, 2020
  3. modified the milestones: v3.4.0, v3.3.0 on Jun 15, 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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions