From 1e9e171f3384b9d6d75b61611e7ab197a8b1d2f6 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 9 Sep 2019 01:02:16 +0200 Subject: [PATCH] Doc: Remove hard-documented rcParams defaults --- .../interpolation_methods.py | 7 +++---- examples/text_labels_and_annotations/unicode_minus.py | 2 +- examples/ticks_and_spines/tick_xlabel_top.py | 7 +++---- lib/matplotlib/axes/_axes.py | 10 +++++----- lib/matplotlib/contour.py | 2 +- lib/matplotlib/figure.py | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/examples/images_contours_and_fields/interpolation_methods.py b/examples/images_contours_and_fields/interpolation_methods.py index 7c7182806cc7..cd420dda9980 100644 --- a/examples/images_contours_and_fields/interpolation_methods.py +++ b/examples/images_contours_and_fields/interpolation_methods.py @@ -6,10 +6,9 @@ This example displays the difference between interpolation methods for :meth:`~.axes.Axes.imshow`. -If *interpolation* is None, it defaults to the :rc:`image.interpolation` -(default: ``'nearest'``). If the interpolation is ``'none'``, then no -interpolation is performed for the Agg, ps and pdf backends. Other backends -will default to ``'antialiased'``. +If *interpolation* is None, it defaults to the :rc:`image.interpolation`. +If the interpolation is ``'none'``, then no interpolation is performed for the +Agg, ps and pdf backends. Other backends will default to ``'antialiased'``. For the Agg, ps and pdf backends, ``interpolation = 'none'`` works well when a big image is scaled down, while ``interpolation = 'nearest'`` works well when diff --git a/examples/text_labels_and_annotations/unicode_minus.py b/examples/text_labels_and_annotations/unicode_minus.py index 860c930a8f83..ce7dba70089d 100644 --- a/examples/text_labels_and_annotations/unicode_minus.py +++ b/examples/text_labels_and_annotations/unicode_minus.py @@ -5,7 +5,7 @@ By default, tick labels at negative values are rendered using a `Unicode minus`__ (U+2212) rather than an ASCII hyphen (U+002D). This can be controlled -by setting :rc:`axes.unicode_minus` (which defaults to True). +by setting :rc:`axes.unicode_minus`. __ https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes diff --git a/examples/ticks_and_spines/tick_xlabel_top.py b/examples/ticks_and_spines/tick_xlabel_top.py index a437810b06a3..5ed2f81c23ce 100644 --- a/examples/ticks_and_spines/tick_xlabel_top.py +++ b/examples/ticks_and_spines/tick_xlabel_top.py @@ -3,10 +3,9 @@ Set default x-axis tick labels on the top ========================================== -We can use :rc:`xtick.labeltop` (default False) and :rc:`xtick.top` -(default False) and :rc:`xtick.labelbottom` (default True) and -:rc:`xtick.bottom` (default True) to control where on the axes ticks and -their labels appear. +We can use :rc:`xtick.labeltop` and :rc:`xtick.top` and :rc:`xtick.labelbottom` +and :rc:`xtick.bottom` to control where on the axes ticks and their labels +appear. These properties can also be set in ``.matplotlib/matplotlibrc``. """ diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 47252c37bed0..8e76198530ff 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -5469,11 +5469,11 @@ def imshow(self, X, cmap=None, norm=None, aspect=None, that the data fit in the axes. In general, this will result in non-square pixels. - If not given, use :rc:`image.aspect` (default: 'equal'). + If not given, use :rc:`image.aspect`. interpolation : str, optional - The interpolation method used. If *None* - :rc:`image.interpolation` is used, which defaults to 'nearest'. + The interpolation method used. If *None*, :rc:`image.interpolation` + is used. Supported values are 'none', 'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', @@ -5782,7 +5782,7 @@ def pcolor(self, *args, alpha=None, norm=None, cmap=None, vmin=None, *edgecolors*\ ="none" is used. This eliminates artificial lines at patch boundaries, and works regardless of the value of alpha. If *edgecolors* is not "none", then the default *antialiaseds* - is taken from :rc:`patch.antialiased`, which defaults to True. + is taken from :rc:`patch.antialiased`. Stroking the edges may be preferred if *alpha* is 1, but will cause artifacts otherwise. @@ -7650,7 +7650,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None, - 'auto': The axes is kept fixed and the aspect is adjusted so that the data fit in the axes. In general, this will result in non-square pixels. - - *None*: Use :rc:`image.aspect` (default: 'equal'). + - *None*: Use :rc:`image.aspect`. Default: 'equal' diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index d1027f39dd41..bc17765c50f8 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1626,7 +1626,7 @@ def _initialize_x_y(self, z): nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual. - Defaults to :rc:`contour.corner_mask`, which defaults to ``True``. + Defaults to :rc:`contour.corner_mask`. colors : color string or sequence of colors, optional The colors of the levels, i.e. the lines for `.contour` and the diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 130980fa0268..a9322a706292 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2100,7 +2100,7 @@ def savefig(self, fname, *, transparent=None, **kwargs): quality : [ *None* | 1 <= scalar <= 100 ] The image quality, on a scale from 1 (worst) to 95 (best). Applicable only if *format* is jpg or jpeg, ignored otherwise. - If *None*, defaults to :rc:`savefig.jpeg_quality` (95 by default). + If *None*, defaults to :rc:`savefig.jpeg_quality`. Values above 95 should be avoided; 100 completely disables the JPEG quantization stage.