-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone
Description
ax.fill broken for log scale and values below zero
When using ax.fill_between in log scale plots with y-values below zero, the result looks broken and areas are filled that should not be filled
Code for reproduction
import numpy as np
import matplotlib.pyplot as plt
xdata=np.arange(0,10,0.01)
ydata = np.exp(-xdata)
edata = 0.2*(10-xdata)*np.cos(5*xdata)*np.exp(-xdata)
fig, ax = plt.subplots()
plt.yscale('log')
ax.fill_between(xdata, ydata - edata, ydata + edata)
plt.savefig("test.png")
Actual outcome
Expected outcome
The correct example has been generated with matplotlib-2.0.2-1
Probably related: #8623
How to deal with invalid values in log scale plots is certainly a matter of definition. However, it should never happen that areas are filled that should not be filled, as it is the case in the example above.
Matplotlib version
- Operating system: arch linux
- Matplotlib version: 2.1.0-1
- Matplotlib backend: Qt5Agg
- Python version: 3.6.2
- Other libraries: numpy version: 1.13.3-1
Everything installed using the package manager of arch linux.
lmazur1990lmazur1990
Metadata
Metadata
Assignees
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.