Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f0400e

Browse files
committed
DOC: re-phrase remove_overlapping_locs prose
1 parent 8fe8c14 commit 6f0400e

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

doc/api/axis_api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ Formatters and Locators
6060
Axis.set_major_locator
6161
Axis.set_minor_formatter
6262
Axis.set_minor_locator
63+
6364
Axis.remove_overlapping_locs
65+
Axis.get_remove_overlapping_locs
66+
Axis.set_remove_overlapping_locs
6467

6568
Axis Label
6669
----------

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,19 @@ Previously, when the *patch_artist* parameter was set, `~Axes.bxp` would ignore
6767

6868
Major/minor tick collisions
6969
~~~~~~~~~~~~~~~~~~~~~~~~~~~
70-
Minor ticks that collide with major ticks are now always hidden.
71-
Previously, certain locator classes (`LogLocator`, `AutoMinorLocator`)
72-
contained custom logic to avoid emitting tick locations that collided with
73-
major ticks when they were used as minor locators.
7470

75-
This logic has now moved to the Axis class, and is used *regardless of the
76-
ticker class*. ``xaxis.minor.locator()`` now includes positions that collide
77-
with ``xaxis.major.locator()``, but ``xaxis.get_minorticklocs()`` does not.
78-
79-
You can control this behavior via the ``.remove_overlap`` attribute on the
80-
minor locator.
71+
Minor ticks that collide with major ticks are now hidden by default.
72+
Previously, certain locator classes (`~.ticker.LogLocator`,
73+
`~.ticker.AutoMinorLocator`) contained custom logic to avoid emitting
74+
tick locations that collided with major ticks when they were used as
75+
minor locators. This logic has now moved to the `~.axis.Axis` class,
76+
and is used regardless of the locator class. You can control this
77+
behavior via the `.Axis.remove_overlaping_locs` attribute on
78+
`~.axis.Axis`.
8179

8280
If you were relying on both the major and minor tick labels to appear
8381
on the same tick, you may need to update your code. For example, the
84-
following snippet labeled days using major ticks, and hours and
85-
minutes using minor ticks and added a newline to the major ticks
86-
labels to avoid them crashing into the minor tick labels. ::
82+
following snippet ::
8783

8884
import numpy as np
8985
import matplotlib.dates as mdates
@@ -100,12 +96,17 @@ labels to avoid them crashing into the minor tick labels. ::
10096
minor_locator=mdates.HourLocator((0, 6, 12, 18)),
10197
minor_formatter=mdates.DateFormatter("%H:%M"),
10298
)
103-
# disable removing overlapping ticks by adding this line
99+
# disable removing overlapping locations
104100
ax.xaxis.remove_overlapping_locs = False
105101
plt.show()
106102

107-
Setting the `.Axis.remove_overlapping_locs` property (also available
108-
via `.Axis.set_remove_overlapping_locs` and `~.pyplot.setp`).
103+
labeled days using major ticks, and hours and minutes using minor
104+
ticks and added a newline to the major ticks labels to avoid them
105+
crashing into the minor tick labels. Setting the
106+
`~.Axis.remove_overlapping_locs` property (also accessible via
107+
`~.Axis.set_remove_overlapping_locs` /
108+
`~.Axis.get_remove_overlapping_locs` and `~.pyplot.setp`) disables
109+
removing overlapping tick locations.
109110

110111
The major tick labels could also be adjusted include hours and
111112
minutes, as the minor ticks are gone, so the ``major_formatter``

0 commit comments

Comments
 (0)