Different xtick pads for subplots within figure

I'm plotting a series of sub plots within a figure, where most are small sub
plots, but the last one spans the width of the figure. For the final subplot
only, I want to set the xtick pad to 20. Something like:

import matplotlib.pyplot as plt

fig = plt.figure()
ax1 = fig.add_subplot(2,2,1)
ax2 = fig.add_subplot(2,2,2)
ax3 = fig.add_subplot(2,1,3)

plt.setp(ax3.xaxis.get_major_ticks(), pad=20)
plt.show()

But this doesn't have any effect on the final plot. I've also tried getting
the ticks individually and calling set_pad(20) i.e.:

for tick in ax3.xaxis.get_major_ticks():
    tick.set_pad(20)

But this does't work either. Anyone have an ideas?

···

--
View this message in context: http://old.nabble.com/Different-xtick-pads-for-subplots-within-figure-tp31150430p31150430.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

This seems to be a bug in matplotlib.
I just opened a bug track for it.

https://github.com/matplotlib/matplotlib/issues/88

As a workaround, try

ax3.tick_params(pad=20)

Regards,

-JJ

···

On Tue, Mar 15, 2011 at 10:43 AM, NotBrianCox <samwisehawkins@...287...> wrote:

I'm plotting a series of sub plots within a figure, where most are small sub
plots, but the last one spans the width of the figure. For the final subplot
only, I want to set the xtick pad to 20. Something like:

import matplotlib.pyplot as plt

fig = plt.figure()
ax1 = fig.add_subplot(2,2,1)
ax2 = fig.add_subplot(2,2,2)
ax3 = fig.add_subplot(2,1,3)

plt.setp(ax3.xaxis.get_major_ticks(), pad=20)
plt.show()

But this doesn't have any effect on the final plot. I've also tried getting
the ticks individually and calling set_pad(20) i.e.:

for tick in ax3.xaxis.get_major_ticks():
tick.set_pad(20)

But this does't work either. Anyone have an ideas?

--
View this message in context: http://old.nabble.com/Different-xtick-pads-for-subplots-within-figure-tp31150430p31150430.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users