matplotlib/matplotlib — pull request #776 by ivanov (2012-03-20 02:08:49+00:00)
Title: ticks based on number of subplots

here's an implementation of adjusting the tick locator depending on how many subplots there are. I implemented this at PyData a few weeks back, but forgot to submit the PR.

to see the goodies of this PR, use this in the ipython notebook

```python
%pylab inline
#rcParams['figure.figsize']=2,2
plt.subplots()
plt.plot(24*np.random.rand(10), np.random.rand(10))
for x in range(7):
fig, axes = plt.subplots(1,x+2, sharey=True)
for ax in axes.flat: ax.plot(24*np.random.rand(10), np.random.rand(10))

plt.subplots()
plt.plot(np.random.rand(10), 24*np.random.rand(10))

for x in range(7):
fig, axes = plt.subplots(x+2,1, sharex=True)
for ax in axes.flat: ax.plot(np.random.rand(10), 24*np.random.rand(10))
#fig.tight_layout()
```

(I'll rebase this if this won't merge cleanly)