8000 DOC: Document default cap styles · impact27/matplotlib@b24acb7 · GitHub
[go: up one dir, main page]

Skip to content

Commit b24acb7

Browse files
committed
DOC: Document default cap styles
- remove '(default)' from cap style demo as this is only true for Line2D and the default rcParameters - document default cap styles for Line2D and Patch in their cap style setters - document default cap style for GraphicsContextBase in the same way as it's already done for joinstyle
1 parent 8451e27 commit b24acb7

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

lib/matplotlib/_enums.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ class CapStyle(str, _AutoStringNameEnum):
128128
For a visual impression of each *CapStyle*, `view these docs online
129129
<CapStyle>` or run `CapStyle.demo`.
130130
131+
By default, `~.backend_bases.GraphicsContextBase` draws a stroked line as
132+
squared off at its endpoints.
133+
131134
**Supported values:**
132135
133136
.. rst-class:: value-list
@@ -168,7 +171,6 @@ def demo():
168171
ax.plot(xx, yy, lw=12, color='tab:blue', solid_capstyle=style)
169172
ax.plot(xx, yy, lw=1, color='black')
170173
ax.plot(xx, yy, 'o', color='tab:red', markersize=3)
171-
ax.text(2.25, 0.55, '(default)', ha='center')
172174

173175
ax.set_ylim(-.5, 1.5)
174176
ax.set_axis_off()

lib/matplotlib/lines.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,8 @@ def set_dash_capstyle(self, s):
13361336
"""
13371337
How to draw the end caps if the line is `~Line2D.is_dashed`.
13381338
1339+
The default capstyle is :rc:`lines.dash_capstyle`.
1340+
13391341
Parameters
13401342
----------
13411343
s : `.CapStyle` or %(CapStyle)s
@@ -1350,6 +1352,8 @@ def set_solid_capstyle(self, s):
13501352
"""
13511353
How to draw the end caps if the line is solid (not `~Line2D.is_dashed`)
13521354
1355+
The default capstyle is :rc:`lines.solid_capstyle`.
1356+
13531357
Parameters
13541358
----------
13551359
s : `.CapStyle` or %(CapStyle)s

lib/matplotlib/patches.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ def set_capstyle(self, s):
474474
"""
475475
Set the `.CapStyle`.
476476
477+
The default capstyle is 'round' for `.FancyArrowPatch` and 'butt' for
478+
all other patches.
479+
477480
Parameters
478481
----------
479482
s : `.CapStyle` or %(CapStyle)s

0 commit comments

Comments
 (0)
0