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

Skip to content

Commit 051240b

Browse files
committed
DOC: tweak whats new for the tick de-confliction logic
1 parent e0ee5fd commit 051240b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ This logic has now moved to the Axis class, and is used *regardless of the
9494
ticker class*. ``xaxis.minor.locator()`` now includes positions that collide
9595
with ``xaxis.major.locator()``, but ``xaxis.get_minorticklocs()`` does not.
9696

97+
You can control this behavior via the ``.remove_overlap`` attribute on the
98+
minor locator.
99+
97100
If you were relying on both the major and minor tick labels to appear on the
98101
same tick, you may need to update your code. For example, the following
99102
snippet labeled days using major ticks, and hours and minutes using minor
@@ -114,15 +117,16 @@ ticks::
114117
minor_locator=mdates.HourLocator((0, 6, 12, 18)),
115118
minor_formatter=mdates.DateFormatter("%H:%M"),
116119
)
117-
120+
# disables tick collision suppression
121+
ax.axis.minor.locator.remove_overlap = False
118122
plt.show()
119123

120124
and added a newline to the major ticks labels to avoid them crashing into the
121125
minor tick labels.
122126

123-
With the API change, the major tick labels should also include hours and
124-
minutes, as the minor ticks are gone, so the ``major_formatter`` should be
125-
``mdates.DateFormatter("%H:%M\n%a")``.
127+
The major tick labels could also be adjusted include hours and
128+
minutes, as the minor ticks are gone, so the ``major_formatter``
129+
should be ``mdates.DateFormatter("%H:%M\n%a")``.
126130

127131
usetex support
128132
~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)