-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc]: .set_linestyle()
tuple method is unclear
#26784
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
Comments
Also, the https://matplotlib.org/stable/gallery/lines_bars_and_markers/line_demo_dash_control.html |
I think this would not be quite right as it seems to imply only a length 2 on-off pattern, whereas any even number should work. The linestyles example explains things pretty well, so possibly a good way to improve here is to just link the example from the docstring? |
There is a PR which deals with most of these things that hopefully will be merged for 3.9: #23056 (The discussions are really about what For the original issue: yes, it is maybe unclear, but correct. Probably it can be clarified a bit further in the PR above, but it does link to the example @rcomer pointed out. An additional challenge here is that |
I haven't seen this page before. Thanks for sharing. And yes, I think having this page linked in the doc would help as well. |
Documentation Link
https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.set_linestyle
Problem
I looked up a method for setting plot's
spine
line style to a custom dash and my lazy eye caught what I highlighted in yellow:I tried this and naturally I got an error:
Only after googling some example and reading the doc very carefully I noticed the correct way to change the line style:
Suggested improvement
I think the
doc
should be re-written so it's more explicit:Alternatively a dash tuple of the following form can be provided:
Where:
offset
: definitionon_ink
/off_ink
: definitionThe text was updated successfully, but these errors were encountered: