From b7949307b1793248b4add776a26f91c2de87d543 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 15 Sep 2022 03:54:52 -0400 Subject: [PATCH] DOC: Fix docs for linestyles in contour The *linestyles* argument docs refer to the rcParam and not the new *negative_linestyles* argument, and the latter doesn't reference the rcParam. --- lib/matplotlib/contour.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 7f66aaa44a3d..6aab5222b783 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -785,8 +785,8 @@ def __init__(self, ax, *args, self._transform = transform self.negative_linestyles = negative_linestyles - # If negative_linestyles was not defined as a kwarg, - # define negative_linestyles with rcParams + # If negative_linestyles was not defined as a keyword argument, define + # negative_linestyles with rcParams if self.negative_linestyles is None: self.negative_linestyles = \ mpl.rcParams['contour.negative_linestyle'] @@ -1746,26 +1746,27 @@ def _initialize_x_y(self, z): linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional *Only applies to* `.contour`. - If *linestyles* is *None*, the default is 'solid' unless the lines - are monochrome. In that case, negative contours will take their - linestyle from :rc:`contour.negative_linestyle` setting. + If *linestyles* is *None*, the default is 'solid' unless the lines are + monochrome. In that case, negative contours will instead take their + linestyle from the *negative_linestyles* argument. - *linestyles* can also be an iterable of the above strings - specifying a set of linestyles to be used. If this - iterable is shorter than the number of contour levels - it will be repeated as necessary. + *linestyles* can also be an iterable of the above strings specifying a set + of linestyles to be used. If this iterable is shorter than the number of + contour levels it will be repeated as necessary. negative_linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, \ optional *Only applies to* `.contour`. - If *negative_linestyles* is None, the default is 'dashed' for - negative contours. + If *linestyles* is *None* and the lines are monochrome, this argument + specifies the line style for negative contours. - *negative_linestyles* can also be an iterable of the above - strings specifying a set of linestyles to be used. If this - iterable is shorter than the number of contour levels - it will be repeated as necessary. + If *negative_linestyles* is *None*, the default is taken from + :rc:`contour.negative_linestyles`. + + *negative_linestyles* can also be an iterable of the above strings + specifying a set of linestyles to be used. If this iterable is shorter than + the number of contour levels it will be repeated as necessary. hatches : list[str], optional *Only applies to* `.contourf`.