From: Anthony M. F. <Ant...@co...> - 2007-07-12 23:37:00
|
Hi All, I'm trying to plot tick labels on the inside (ie data side) of a typical x-y plot. My setup is Python 2.5.1, matplotlib 0.90.0 on WinXP. I've been able to accomplish this by adjusting the padding of the individual ticks, but it doesn't quite accomplish what I want. For example, imagine a typical x-y plot, except that the tick labels are on the right-hand side (by setting axes.yaxis.tick_right()). Adjusting the padding of the ticks by doing: for tick in axes.yaxis.get_major_ticks(): tick.set_pad(-25) I'm able to get the numbers to appear about where I want. The problem is that these numbers are left aligned. So, it works fine for small numbers, but for large numbers, or when my tick formatter switches over to using scientific notation the numbers will overlap the axis. If my labels are on the inside of the right-hand side, I want them to be right-aligned and grow left towards the centre of the plot. I thought about doing it by setting tick_left() and then using a (large) computed pad, but then the tick lines are on the wrong side. So, my question is: can I get right-aligned tick labels on the right-side of a plot? How? I suspect I can do this by using axis.set_offset_position('...'), but I've been unable to get that to do anything in my tests using pylab. I can post code if it'll be helpful. Thanks, Anthony. -- Anthony Floyd, PhD Convergent Manufacturing Technologies Inc. 6190 Agronomy Rd, Suite 403 Vancouver BC V6T 1Z3 CANADA Email: Ant...@co... | Tel: 604-822-9682 WWW: http://www.convergent.ca | Fax: 604-822-9659 =20 CMT is hiring: See http://www.convergent.ca for details |