10000 Remove redundant rcParam-lookup · matplotlib/matplotlib@3d0ff67 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d0ff67

Browse files
committed
Remove redundant rcParam-lookup
* No need to lookup rcParam fallback in __init__ as it is done in the set-methods and not used before calling set-methods. * patch.linewidth is a float, so represent default as float.
1 parent 53c5f88 commit 3d0ff67

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

lib/matplotlib/mpl-data/matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
## Patches are graphical objects that fill 2D space, like polygons or circles.
142142
## See https://matplotlib.org/api/artist_api.html#module-matplotlib.patches
143143
## for more information on patch properties.
144-
#patch.linewidth: 1 # edge width in points.
144+
#patch.linewidth: 1.0 # edge width in points.
145145
#patch.facecolor: C0
146146
#patch.edgecolor: black # if forced, or patch is not filled
147147
#patch.force_edgecolor: False # True to always use edgecolor

lib/matplotlib/patches.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,12 @@ def __init__(self,
7575
"""
7676
super().__init__()
7777

78-
if linewidth is None:
79-
linewidth = mpl.rcParams['patch.linewidth']
8078
if linestyle is None:
8179
linestyle = "solid"
8280
if capstyle is None:
8381
capstyle = CapStyle.butt
8482
if joinstyle is None:
8583
joinstyle = JoinStyle.miter
86-
if antialiased is None:
87-
antialiased = mpl.rcParams['patch.antialiased']
8884

8985
self._hatch_color = colors.to_rgba(mpl.rcParams['hatch.color'])
9086
self._fill = True # needed for set_facecolor call
@@ -405,8 +401,6 @@ def set_linewidth(self, w):
405401
"""
406402
if w is None:
407403
w = mpl.rcParams['patch.linewidth']
408-
if w is None:
409-
w = mpl.rcParams['axes.linewidth']
410404
self._linewidth = float(w)
411405
self._dash_pattern = mlines._scale_dashes(
412406
*self._unscaled_dash_pattern, w)

0 commit comments

Comments
 (0)
0