Skip to content

Commit

Permalink
document api_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maqifrnswa committed Mar 15, 2016
1 parent 34d476d commit 1e89b2b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions doc/api/api_changes/2015-03-14-SSH.rst
@@ -0,0 +1,16 @@
``matplotlib.ticker.LinearLocator`` algorithm update
```````````````````````````

The ``matplotlib.ticker.LinearLocator`` is used to define the range and location
of tickmarks of a plot when the user wants a exact number of ticks.
``LinearLocator`` thus differs from the default locator ``MaxNLocator``, which
does not necessarily return the exact user requested number of ticks.

The view range algorithm in ``matplotlib.ticker.LinearLocator`` has been
changed so that more convenient tick location are chosen. The new algorithm
returns a plot view range that is a multiple of the user requested number of
ticks. This ensures tick marks to be located at whole integers more
constistently. For example, when both y-axis of a``twinx`` plot use
``matplotlib.ticker.LinearLocator`` with the same number of ticks, the grids of
both axis will be properly aligned at convenient tick locations.

3 changes: 2 additions & 1 deletion lib/matplotlib/axes/_base.py
Expand Up @@ -3780,7 +3780,8 @@ def twinx(self):
create a twin of Axes for generating a plot with a sharex
x-axis but independent y axis. The y-axis of self will have
ticks on left and the returned axes will have ticks on the
right.
right. To ensure tick marks of both axis align, see
:class:`~matplotlib.ticker.LinearLocator`
.. note::
For those who are 'picking' artists while using twinx, pick
Expand Down

0 comments on commit 1e89b2b

Please sign in to comment.