Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOC: Add a warning that ticks are not persistent#26436

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 1 commit intomatplotlib:mainfromtimhoffm:warn-ticks
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
53 changes: 51 additions & 2 deletionslib/matplotlib/axis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -619,6 +619,18 @@ class Axis(martist.Artist):
The acceptance radius for containment tests. See also `.Axis.contains`.
majorTicks : list of `.Tick`
The major ticks.

.. warning::

Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that changes to individual ticks will not
survive if you work on the figure further (including also
panning/zooming on a displayed figure).

Working on the individual ticks is a method of last resort.
Use `.set_tick_params` instead if possible.

minorTicks : list of `.Tick`
The minor ticks.
"""
Expand DownExpand Up@@ -1591,7 +1603,20 @@ def get_minor_formatter(self):
return self.minor.formatter

def get_major_ticks(self, numticks=None):
r"""Return the list of major `.Tick`\s."""
r"""
Return the list of major `.Tick`\s.

.. warning::

Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that changes to individual ticks will not
survive if you work on the figure further (including also
panning/zooming on a displayed figure).

Working on the individual ticks is a method of last resort.
Use `.set_tick_params` instead if possible.
"""
if numticks is None:
numticks = len(self.get_majorticklocs())

Expand All@@ -1604,7 +1629,20 @@ def get_major_ticks(self, numticks=None):
return self.majorTicks[:numticks]

def get_minor_ticks(self, numticks=None):
r"""Return the list of minor `.Tick`\s."""
r"""
Return the list of minor `.Tick`\s.

.. warning::

Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that changes to individual ticks will not
survive if you work on the figure further (including also
panning/zooming on a displayed figure).

Working on the individual ticks is a method of last resort.
Use `.set_tick_params` instead if possible.
"""
if numticks is None:
numticks = len(self.get_minorticklocs())

Expand DownExpand Up@@ -1952,6 +1990,17 @@ def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
**kwargs
Text properties.

.. warning::

This only sets the properties of the current ticks.
Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that these settings can get lost if you work on
the figure further (including also panning/zooming on a
displayed figure).

Use `.set_tick_params` instead if possible.

Returns
-------
list of `.Text`\s
Expand Down
22 changes: 22 additions & 0 deletionslib/matplotlib/projections/polar.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1317,6 +1317,17 @@ def set_thetagrids(self, angles, labels=None, fmt=None, **kwargs):
**kwargs
*kwargs* are optional `.Text` properties for the labels.

.. warning::

This only sets the properties of the current ticks.
Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that these settings can get lost if you work on
the figure further (including also panning/zooming on a
displayed figure).

Use `.set_tick_params` instead if possible.

See Also
--------
.PolarAxes.set_rgrids
Expand DownExpand Up@@ -1369,6 +1380,17 @@ def set_rgrids(self, radii, labels=None, angle=None, fmt=None, **kwargs):
**kwargs
*kwargs* are optional `.Text` properties for the labels.

.. warning::

This only sets the properties of the current ticks.
Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that these settings can get lost if you work on
the figure further (including also panning/zooming on a
displayed figure).

Use `.set_tick_params` instead if possible.

See Also
--------
.PolarAxes.set_thetagrids
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp