Skip to content

Commit c551a56

Browse files
authored
DOC: Fix docs for linestyles in contour (#23892)
The *linestyles* argument docs refer to the rcParam and not the new *negative_linestyles* argument, and the latter doesn't reference the rcParam.
1 parent 6a29803 commit c551a56

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

lib/matplotlib/contour.py

+16-15
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,8 @@ def __init__(self, ax, *args,
785785
self._transform = transform
786786

787787
self.negative_linestyles = negative_linestyles
788-
# If negative_linestyles was not defined as a kwarg,
789-
# define negative_linestyles with rcParams
788+
# If negative_linestyles was not defined as a keyword argument, define
789+
# negative_linestyles with rcParams
790790
if self.negative_linestyles is None:
791791
self.negative_linestyles = \
792792
mpl.rcParams['contour.negative_linestyle']
@@ -1746,26 +1746,27 @@ def _initialize_x_y(self, z):
17461746
linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
17471747
*Only applies to* `.contour`.
17481748
1749-
If *linestyles* is *None*, the default is 'solid' unless the lines
1750-
are monochrome. In that case, negative contours will take their
1751-
linestyle from :rc:`contour.negative_linestyle` setting.
1749+
If *linestyles* is *None*, the default is 'solid' unless the lines are
1750+
monochrome. In that case, negative contours will instead take their
1751+
linestyle from the *negative_linestyles* argument.
17521752
1753-
*linestyles* can also be an iterable of the above strings
1754-
specifying a set of linestyles to be used. If this
1755-
iterable is shorter than the number of contour levels
1756-
it will be repeated as necessary.
1753+
*linestyles* can also be an iterable of the above strings specifying a set
1754+
of linestyles to be used. If this iterable is shorter than the number of
1755+
contour levels it will be repeated as necessary.
17571756
17581757
negative_linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, \
17591758
optional
17601759
*Only applies to* `.contour`.
17611760
1762-
If *negative_linestyles* is None, the default is 'dashed' for
1763-
negative contours.
1761+
If *linestyles* is *None* and the lines are monochrome, this argument
1762+
specifies the line style for negative contours.
17641763
1765-
*negative_linestyles* can also be an iterable of the above
1766-
strings specifying a set of linestyles to be used. If this
1767-
iterable is shorter than the number of contour levels
1768-
it will be repeated as necessary.
1764+
If *negative_linestyles* is *None*, the default is taken from
1765+
:rc:`contour.negative_linestyles`.
1766+
1767+
*negative_linestyles* can also be an iterable of the above strings
1768+
specifying a set of linestyles to be used. If this iterable is shorter than
1769+
the number of contour levels it will be repeated as necessary.
17691770
17701771
hatches : list[str], optional
17711772
*Only applies to* `.contourf`.

0 commit comments

Comments
 (0)