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

Appearance settings

Commit f2f87e3

Browse filesBrowse files
committed
Rename rcparam contour.linewidths to contour.linewidth
1 parent 207fd7d commit f2f87e3
Copy full SHA for f2f87e3

File tree

Expand file treeCollapse file tree

5 files changed

+11
-11
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+11
-11
lines changed

‎doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidths.rst renamed to ‎doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst

Copy file name to clipboardExpand all lines: doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Add :rc:`contour.linewidths` to rcParams
2-
----------------------------------------
1+
Add :rc:`contour.linewidth` to rcParams
2+
---------------------------------------
33

4-
The new config option :rc:`contour.linewidths` allows to control the default
4+
The new config option :rc:`contour.linewidth` allows to control the default
55
linewidth of contours as a float. When set to ``None``, the linewidths fall
66
back to :rc:`lines.linewidth`. The config value is overidden as usual
77
by the ``linewidths`` argument passed to `~.axes.Axes.contour` when

‎lib/matplotlib/contour.py

Copy file name to clipboardExpand all lines: lib/matplotlib/contour.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ def _process_linewidths(self):
12571257
linewidths = self.linewidths
12581258
Nlev = len(self.levels)
12591259
if linewidths is None:
1260-
default_linewidth = mpl.rcParams['contour.linewidths']
1260+
default_linewidth = mpl.rcParams['contour.linewidth']
12611261
if default_linewidth is None:
12621262
default_linewidth = mpl.rcParams['lines.linewidth']
12631263
tlinewidths = [(default_linewidth,)] * Nlev
@@ -1752,7 +1752,7 @@ def _initialize_x_y(self, z):
17521752
however introduce rendering artifacts at chunk boundaries depending
17531753
on the backend, the *antialiased* flag and value of *alpha*.
17541754
1755-
linewidths : float or array-like, default: :rc:`contour.linewidths`
1755+
linewidths : float or array-like, default: :rc:`contour.linewidth`
17561756
*Only applies to* `.contour`.
17571757
17581758
The line width of the contour lines.

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ def _convert_validator_spec(key, conv):
11951195
# contour props
11961196
'contour.negative_linestyle': ['dashed', _validate_linestyle],
11971197
'contour.corner_mask': [True, validate_bool],
1198-
'contour.linewidths': [None, validate_float_or_None],
1198+
'contour.linewidth': [None, validate_float_or_None],
11991199

12001200
# errorbar props
12011201
'errorbar.capsize': [0, validate_float],

‎lib/matplotlib/tests/test_contour.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_contour.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,16 @@ def test_contour_uneven():
378378

379379

380380
@pytest.mark.parametrize(
381-
"rc_lines_linewidth, rc_contour_linewidths, call_linewidths, expected", [
381+
"rc_lines_linewidth, rc_contour_linewidth, call_linewidths, expected", [
382382
(1.23, None, None, 1.23),
383383
(1.23, 4.24, None, 4.24),
384384
(1.23, 4.24, 5.02, 5.02)
385385
])
386-
def test_contour_linewidths(
387-
rc_lines_linewidth, rc_contour_linewidths, call_linewidths, expected):
386+
def test_contour_linewidth(
387+
rc_lines_linewidth, rc_contour_linewidth, call_linewidths, expected):
388388

389389
with rc_context(rc={"lines.linewidth": rc_lines_linewidth,
390-
"contour.linewidths": rc_contour_linewidths}):
390+
"contour.linewidth": rc_contour_linewidth}):
391391
fig, ax = plt.subplots()
392392
X = np.arange(4*3).reshape(4, 3)
393393
cs = ax.contour(X, linewidths=call_linewidths)

‎matplotlibrc.template

Copy file name to clipboardExpand all lines: matplotlibrc.template
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@
574574
## ***************************************************************************
575575
#contour.negative_linestyle: dashed # string or on-off ink sequence
576576
#contour.corner_mask: True # {True, False, legacy}
577-
#contour.linewidths : None # {float, None} Size of the contour
577+
#contour.linewidth: None # {float, None} Size of the contour
578578
# linewidths. If set to None,
579579
# it falls back to `line.linewidth`.
580580

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.