Skip to content

Backport PR #28743 on branch v3.9.2-doc (Minor fixes in ticker docs) #28748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading