From d9d1a4d3f6612e9349f1607f46f359bdce8934f6 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:20:39 +0200 Subject: [PATCH] Backport PR #28743: Minor fixes in ticker docs --- lib/matplotlib/ticker.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 2b00937f9e29..d824bbe3b6e2 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -435,10 +435,10 @@ class ScalarFormatter(Formatter): lim = (1_000_000, 1_000_010) fig, (ax1, ax2, ax3) = plt.subplots(3, 1, gridspec_kw={'hspace': 2}) - ax1.set(title='offset_notation', xlim=lim) + ax1.set(title='offset notation', xlim=lim) ax2.set(title='scientific notation', xlim=lim) ax2.xaxis.get_major_formatter().set_useOffset(False) - ax3.set(title='floating point notation', xlim=lim) + ax3.set(title='floating-point notation', xlim=lim) ax3.xaxis.get_major_formatter().set_useOffset(False) ax3.xaxis.get_major_formatter().set_scientific(False) @@ -1146,10 +1146,10 @@ def __init__( Parameters ---------- use_overline : bool, default: False - If x > 1/2, with x = 1-v, indicate if x should be displayed as - $\overline{v}$. The default is to display $1-v$. + If x > 1/2, with x = 1 - v, indicate if x should be displayed as + $\overline{v}$. The default is to display $1 - v$. - one_half : str, default: r"\frac{1}{2}" + one_half : str, default: r"\\frac{1}{2}" The string used to represent 1/2. minor : bool, default: False @@ -1179,9 +1179,9 @@ def use_overline(self, use_overline): Parameters ---------- - use_overline : bool, default: False - If x > 1/2, with x = 1-v, indicate if x should be displayed as - $\overline{v}$. The default is to display $1-v$. + use_overline : bool + If x > 1/2, with x = 1 - v, indicate if x should be displayed as + $\overline{v}$. The default is to display $1 - v$. """ self._use_overline = use_overline @@ -1189,7 +1189,7 @@ def set_one_half(self, one_half): r""" Set the way one half is displayed. - one_half : str, default: r"\frac{1}{2}" + one_half : str The string used to represent 1/2. """ self._one_half = one_half @@ -1707,14 +1707,14 @@ def tick_values(self, vmin, vmax): class FixedLocator(Locator): - """ + r""" Place ticks at a set of fixed values. If *nbins* is None ticks are placed at all values. Otherwise, the *locs* array of - possible positions will be subsampled to keep the number of ticks <= - :math:`nbins* +1`. The subsampling will be done to include the smallest absolute - value; for example, if zero is included in the array of possibilities, then it of - the chosen ticks. + possible positions will be subsampled to keep the number of ticks + :math:`\leq nbins + 1`. The subsampling will be done to include the smallest + absolute value; for example, if zero is included in the array of possibilities, then + it will be included in the chosen ticks. """ def __init__(self, locs, nbins=None): @@ -1861,9 +1861,9 @@ def __init__(self, base=1.0, offset=0.0): """ Parameters ---------- - base : float > 0 + base : float > 0, default: 1.0 Interval between ticks. - offset : float + offset : float, default: 0.0 Value added to each multiple of *base*. .. versionadded:: 3.8 @@ -1877,9 +1877,9 @@ def set_params(self, base=None, offset=None): Parameters ---------- - base : float > 0 + base : float > 0, optional Interval between ticks. - offset : float + offset : float, optional Value added to each multiple of *base*. .. versionadded:: 3.8