-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc]: Clarify default capstyle #21979
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
If we mention the I'm undecided whether that's still reasonable in the plot or whether we should discuss defaults in a dedicated section. I tend to go with the latter. Joinstyle is also different (#18597). While at it, it should be addressed in the same fashion. |
maybe just document the default capstyle in matplotlib/lib/matplotlib/patches.py Lines 473 to 475 in be35409
matplotlib/lib/matplotlib/collections.py Lines 632 to 634 in 092f833
matplotlib/lib/matplotlib/lines.py Lines 1343 to 1346 in 092f833
matplotlib/lib/matplotlib/lines.py Lines 1329 to 1331 in 092f833
In addition to that we could determine the default
(the same for |
While making the example I noticed the following inconsistency: matplotlib/lib/matplotlib/patches.py Lines 485 to 487 in be35409
matplotlib/lib/matplotlib/markers.py Lines 327 to 328 in f6e0ee4
return a CapStyle object while the other 3 methods return a string (i.e. ...capstyle.name ).
Is this something a separate issue should be opened for? (at least it should be documented which type is returned in each case). |
There's another exception (which is, however, correctly documented #13647): matplotlib/lib/matplotlib/patches.py Lines 4277 to 4282 in 1535cdc
|
And the last one: matplotlib/lib/matplotlib/markers.py Line 288 in f6e0ee4
Also not documented: matplotlib/lib/matplotlib/markers.py Lines 249 to 250 in f6e0ee4
|
In total we seem to have the following defaults (hope that I didn't overlook anything) :
So maybe it's indeed not so good an idea to give the defaults in the demo but rather document them with their classes. |
Documentation Link
https://matplotlib.org/devdocs/api/_enums_api.html#matplotlib._enums.CapStyle
Problem
The demo states that the default capstyle is
projecting
, which is true forLine2D
but not forPathPatch
(where the default is 'butt').(see also https://stackoverflow.com/a/70381813/3944322)
Suggested improvement
Change
(default)
to(default for Line2D)
inmatplotlib/lib/matplotlib/_enums.py
Line 171 in 98115e9
Matplotlib Version
3.5.0
The text was updated successfully, but these errors were encountered: