Skip to content

Commit

Permalink
Backport PR matplotlib#28743: Minor fixes in ticker docs
Browse files Browse the repository at this point in the history
  • Loading branch information
timhoffm authored and meeseeksmachine committed Aug 22, 2024
1 parent 90c0780 commit d9d1a4d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1179,17 +1179,17 @@ 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

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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d9d1a4d

Please sign in to comment.