Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5325e27

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 parent70957d8 commit5325e27

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,7 @@ def get_solid_joinstyle(self):
13291329
defset_dash_capstyle(self,s):
13301330
"""
13311331
How to draw the end caps if the line is `~Line2D.is_dashed`.
1332+
The default capstyle is set by ``rcParams['lines.dash_capstyle']``.
13321333
13331334
Parameters
13341335
----------
@@ -1343,6 +1344,7 @@ def set_dash_capstyle(self, s):
13431344
defset_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 set by ``rcParams['lines.solid_capstyle']``.
13461348
13471349
Parameters
13481350
----------

‎lib/matplotlib/patches.py

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp