Closed JeppeKlitgaard closed 7 months ago
Hi, this is documented:
Dashes are specified as in matplotlib: a tuple of
(segment, gap)
lengths, or an empty string to draw a solid line.
-1 on having both style
and styles
that is much too confusing imo
Going to close as this is intentional and documented — the dash patterns are a superset of the linestyle codes and they ultimately set the same underlying matplotlib attributes so you could never use them at the same time.
I completely understand you want to avoid the confusion of having style
and styles
. Would you consider adding a check on the form of the dashes
argument to give a more intuitive error?
When using
lineplot
withstyle
set to a categorial, thedashes
argument cannot be specified using the conventional matplotlib strings likedashed
or-
, but must take a list of dash tuples like(1, 0)
, otherwise it fails with a nasty error.MWE:
Gives:
The intended behaviour can be obtained using
dashes=[(1, 0), (1, 0)]
This is because
Line2D.set_dashes
is used instead ofLine2D.set_linestyle
. Perhaps an additional argumentstyles=
could be added which would use theset_linestyle
method instead?