File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change
1
+ ``matplotlib.ticker.LinearLocator `` algorithm update
2
+ ```````````````````````````
3
+
4
+ The ``matplotlib.ticker.LinearLocator `` is used to define the range and location
5
+ of tickmarks of a plot when the user wants a exact number of ticks.
6
+ ``LinearLocator `` thus differs from the default locator ``MaxNLocator ``, which
7
+ does not necessarily return the exact user requested number of ticks.
8
+
9
+ The view range algorithm in ``matplotlib.ticker.LinearLocator `` has been
10
+ changed so that more convenient tick location are chosen. The new algorithm
11
+ returns a plot view range that is a multiple of the user requested number of
12
+ ticks. This ensures tick marks to be located at whole integers more
13
+ constistently. For example, when both y-axis of a``twinx`` plot use
14
+ ``matplotlib.ticker.LinearLocator `` with the same number of ticks, the grids of
15
+ both axis will be properly aligned at convenient tick locations.
16
+
Original file line number Diff line number Diff line change @@ -3762,7 +3762,8 @@ def twinx(self):
3762
3762
create a twin of Axes for generating a plot with a sharex
3763
3763
x-axis but independent y axis. The y-axis of self will have
3764
3764
ticks on left and the returned axes will have ticks on the
3765
- right.
3765
+ right. To ensure tick marks of both axis align, see
3766
+ :class:`~matplotlib.ticker.LinearLocator`
3766
3767
3767
3768
.. note::
3768
3769
For those who are 'picking' artists while using twinx, pick
You can’t perform that action at this time.
0 commit comments