You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linestyle="None" argument for fill_between() doesn't work #6693
@tacaswell Are you sure it has been fixed? Because with mpl '2.0.0b1.post1771+g5dfe000', plt.fill_between([1,2,3], [4,5,6], 5, linestyle=MyLS) with the tested “MyLS” being("None", " ", "") still raises ValueError: Do not know how to convert None to dashes
It looks like @RafiKueng is right about the origin of the error: mlines.get_dash_pattern expects only an argument in {'solid', 'dashed', 'dotted', 'dashdot'}, but unfortunately, here this method is called by mcollections.Collection.set_linestyle which also accept arguments like "None" that are not transformed into any of those 4 names by cbook.ls_mapper.get before calling mlines.get_dash_pattern…
supposed to produce (with mpl 2.0.0b1.post1771+g5dfe000)
? First, the dashes don't seem to scale accordingly to the linewidth. Second if lw is None (default) then even with a named linestyle, no edge line is visible.
It seems however to me that the result was OK with mpl 1.5.1 (anaconda2):
Activity
RafiKueng commentedon Jul 5, 2016
Unfortunately, I don't know the code at all, but I guess a fix would need to add here:
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/cbook.py#L2022
and then to add the a return value (offset, dashes) for style 'none' here:
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/lines.py#L37
Unfortunately, I don't know what are valid (offset, dashes) that lead to no line...
tacaswell commentedon Jul 5, 2016
Can you try with the 2.0.0b1 or 1.5.2 releases? I think we fixed this in another way.
afvincent commentedon Jul 5, 2016
@tacaswell Are you sure it has been fixed? Because with mpl '2.0.0b1.post1771+g5dfe000',
plt.fill_between([1,2,3], [4,5,6], 5, linestyle=MyLS)with the tested “MyLS” being("None", " ", "") still raisesValueError: Do not know how to convert None to dashestacaswell commentedon Jul 5, 2016
Then no 😞 We fixed some other normalization of the dashes then.
afvincent commentedon Jul 5, 2016
It looks like @RafiKueng is right about the origin of the error:
mlines.get_dash_patternexpects only an argument in {'solid', 'dashed', 'dotted', 'dashdot'}, but unfortunately, here this method is called bymcollections.Collection.set_linestylewhich also accept arguments like "None" that are not transformed into any of those 4 names bycbook.ls_mapper.getbefore callingmlines.get_dash_pattern…afvincent commentedon Jul 5, 2016
I've been playing a bit with the linestyle options of
fill_betweenand I've encountered several weird behaviors. Is the following scriptsupposed to produce (with mpl 2.0.0b1.post1771+g5dfe000)

? First, the dashes don't seem to scale accordingly to the linewidth. Second if lw is
None(default) then even with a named linestyle, no edge line is visible.It seems however to me that the result was OK with mpl 1.5.1 (anaconda2):

FIX: do dash scaling early
FIX: do dash scaling early
asker4ik commentedon Dec 30, 2019
should be linestyle = 'none'. case sensitive
bilderbuchi commentedon Feb 12, 2020
@asker4ik this works for you? When I do that, I still get
ValueError: Do not know how to convert 'none' to dasheswith mpl 3.1.3