From be8430b47b2d3941553a69a1768c46f9c0a762d6 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 10 Oct 2020 23:35:52 +0200 Subject: [PATCH] Individualize contour and contourf docstrings Both use the same docstring from mcontour.QuadContourSet._contour_doc. At least make the summary line and call signatures explicit to be more clear. --- lib/matplotlib/axes/_axes.py | 18 ++++++++++++++++-- lib/matplotlib/contour.py | 5 ----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 40b21ec02dc6..08d6cb3dd175 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6240,7 +6240,14 @@ def contour(self, *args, **kwargs): contours = mcontour.QuadContourSet(self, *args, **kwargs) self._request_autoscale_view() return contours - contour.__doc__ = mcontour.QuadContourSet._contour_doc + contour.__doc__ = """ + Plot contour lines. + + Call signature:: + + contour([X, Y,] Z, [levels], **kwargs) + + """ + mcontour.QuadContourSet._contour_doc @_preprocess_data() def contourf(self, *args, **kwargs): @@ -6248,7 +6255,14 @@ def contourf(self, *args, **kwargs): contours = mcontour.QuadContourSet(self, *args, **kwargs) self._request_autoscale_view() return contours - contourf.__doc__ = mcontour.QuadContourSet._contour_doc + contourf.__doc__ = """ + Plot filled contours. + + Call signature:: + + contourf([X, Y,] Z, [levels], **kwargs) + + """ + mcontour.QuadContourSet._contour_doc def clabel(self, CS, levels=None, **kwargs): """ diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index c06621c272c3..d700beeee916 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1555,11 +1555,6 @@ def _initialize_x_y(self, z): return np.meshgrid(x, y) _contour_doc = """ - Plot contours. - - Call signature:: - - contour([X, Y,] Z, [levels], **kwargs) `.contour` and `.contourf` draw contour lines and filled contours, respectively. Except as noted, function signatures and return values