Skip to content

Commit aa37c32

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 70957d8 commit aa37c32

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/matplotlib/_enums.py

+3-1
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

+2
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,7 @@ def get_solid_joinstyle(self):
13291329
def set_dash_capstyle(self, s):
13301330
"""
13311331
How to draw the end caps if the line is `~Line2D.is_dashed`.
1332+
The default capstyle is :rc:`lines.dash_capstyle`.
13321333
13331334
Parameters
13341335
----------
@@ -1343,6 +1344,7 @@ def set_dash_capstyle(self, s):
13431344
def set_solid_capstyle(self, s):
13441345
"""
13451346
How to draw the end caps if the line is solid (not `~Line2D.is_dashed`)
1347+
The default capstyle is :rc:`lines.solid_capstyle`.
13461348
13471349
Parameters
13481350
----------

lib/matplotlib/patches.py

+2
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ def get_fill(self):
473473
def set_capstyle(self, s):
474474
"""
475475
Set the `.CapStyle`.
476+
The default capstyle is 'round' for `.FancyArrowPatch` and 'butt' for
477+
all other patches.
476478
477479
Parameters
478480
----------

0 commit comments

Comments
 (0)