Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae7f973

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #22053: DOC: Document default cap styles
1 parent 76156a9 commit ae7f973

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
@@ -1337,6 +1337,8 @@ def set_dash_capstyle(self, s):
13371337
"""
13381338
How to draw the end caps if the line is `~Line2D.is_dashed`.
13391339
1340+
The default capstyle is :rc:`lines.dash_capstyle`.
1341+
13401342
Parameters
13411343
----------
13421344
s : `.CapStyle` or %(CapStyle)s
@@ -1351,6 +1353,8 @@ def set_solid_capstyle(self, s):
13511353
"""
13521354
How to draw the end caps if the line is solid (not `~Line2D.is_dashed`)
13531355
1356+
The default capstyle is :rc:`lines.solid_capstyle`.
1357+
13541358
Parameters
13551359
----------
13561360
s : `.CapStyle` or %(CapStyle)s

lib/matplotlib/patches.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ def set_capstyle(self, s):
479479
"""
480480
Set the `.CapStyle`.
481481
482+
The default capstyle is 'round' for `.FancyArrowPatch` and 'butt' for
483+
all other patches.
484+
482485
Parameters
483486
----------
484487
s : `.CapStyle` or %(CapStyle)s

0 commit comments

Comments
 (0)