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
fill_between() no longer works with border linewidth of 0 #3929
Comments
Can you try this on either the 1.4.x branch or the master branch? Can you provide a minimal working example? |
The behavior is the same on the master branch. Obviously its not a big deal since you can just set the linewidth to a very small value and it behaves almost identically to setting linewidth to 0. Here is a small example:
|
I can not confirm this, the output looks correct to me on the master branch and the current 1.4.x brach (tweaked the code a bit to use import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 2, 0.01)
y1 = np.sin(2*np.pi*x)
y2 = 1.2*np.sin(4*np.pi*x)
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, sharex=True)
ax1.fill_between(x, y1, y2, alpha = 0.2, lw=5)
ax1.set_ylabel('lw=5')
ax2.fill_between(x, y1, y2, alpha = 0.2, lw=0.01)
ax2.set_ylabel('lw=0.01')
ax3.fill_between(x, y1, y2, alpha = 0.2, lw=0)
ax3.set_ylabel('lw=0 (should still show fill)')
ax3.set_xlabel('x')
ax3.plot(x, y1, linestyle='--', color='k')
plt.show() |
This is broken for me as well. fill_between() with linewidth=0 was working in 1.4.0, but now in 1.4.2 it results in not plotting anything. Even trying to add a legend says that there were no labeled objects found. @tacaswell when I run your example, ax3 shows only the dashed line. |
This has been fixed in 1.4.3 |
Great, thanks. |
Great! |
In 1.4.2, fill_between() does not always work when passing in lw=0 (to remove the border from the fill).
To reproduce, edit examples/pylab_examples/fill_between_demo.py and add argument "lw=0" in the first fill_between() call. Run the demo and notice how the fill no longer appears (in previous matplotlib versions it would appear -- but with no border).
The text was updated successfully, but these errors were encountered: