From abad4b609de23b3a53b171e495907d43333f6164 Mon Sep 17 00:00:00 2001 From: pharshalp Date: Sun, 16 Feb 2020 13:44:17 -0500 Subject: [PATCH] MaxNLocator and contour/contourf doc update --- lib/matplotlib/contour.py | 6 ++++-- lib/matplotlib/ticker.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index acf3fc0c8353..59e984db2d0d 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1612,8 +1612,10 @@ def _initialize_x_y(self, z): levels : int or array-like, optional Determines the number and positions of the contour lines / regions. - If an int *n*, use *n* data intervals; i.e. draw *n+1* contour - lines. The level heights are automatically chosen. + If an int *n*, use an algorithm + (see `~matplotlib.ticker.MaxNLocator`) that tries to provide + no more than *n+1* "nice" contour levels between vmin and vmax. + The level heights are automatically chosen. If array-like, draw contour lines at the specified levels. The values must be in increasing order. diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index f370a97dc77a..6414b21d9905 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1991,7 +1991,8 @@ def ge(self, x): class MaxNLocator(Locator): """ - Select no more than N intervals at nice locations. + Find nice tick locations with no more than N being within the view limits. + Locations beyond the limits are added to support autoscaling. """ default_params = dict(nbins=10, steps=None,