matplotlib/matplotlib — Issue #610: MultipleLocator does not work with axisartist
Author: ukch
Created: 2011-12-06 17:35:00+00:00
State: open

Using an adapted version of the code from http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo1.html, adapted to use axisartist (and also adapted to use interval of 50, not 20, as 20 is the default for this data set)

```python
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import mpl_toolkits.axisartist as AA

majorLocator = MultipleLocator(50)
majorFormatter = FormatStrFormatter('%d')
minorLocator = MultipleLocator(5)

t = arange(0.0, 100.0, 0.1)
s = sin(0.1*pi*t)*exp(-t*0.01)

ax = AA.Subplot(Figure(), 111)
plot(t,s)

ax.xaxis.set_major_locator(majorLocator)
ax.xaxis.set_major_formatter(majorFormatter)

#for the minor ticks, use no labels; default NullFormatter
ax.xaxis.set_minor_locator(minorLocator)

show()
```

Expect:

* Ticks at positions 0, 50 and 100.

Actual:

* Ticks at positions 0, 20, 40, 60, 80 and 100.