|
From: Mathew Y. <my...@jp...> - 2008-10-13 19:16:09
|
Thanks Angus. I tried this out ... it works once and only once! BTW, The correct thing to do is res=fig.gca() res.fmt_xdata=foo() #instead of format_xdata res.fmt_ydata=foo() although, like I said, it only first for the first event. Somehow res.fmt_xdata is getting set back to None Mathew Angus McMorland wrote: > Hi Mathew, > > 2008/10/13 Mathew Yeates <my...@jp... > <mailto:my...@jp...>> > > Okay, I've gotten this far. I have a Figure and I think I can > change the > formatting of the values displayed in the toolbar by setting > taking the > X axis and setting the function > format_xdata > to something of my own (something that computes lat/lon). Similar idea > for the Y axis. > > So, given my figure, how do I get the X and Y axis? All I see is > gca(). > But how can I get both? Using fig.get_axes() I only got 1 axis. > > > I think this is a terminology issue: the axis objects returned by > gca() or in the list returned by get_axes() incorporate both the > 'axes' in the sense of x and y axes. With the single result of gca() > you can get at both the x and y axes. For example: > > import matplotlib.pyplot as plt > ax = plt.gca() > ax.set_xlims(xmin=-1) > ax.set_ylims(ymax=0) > ax.format_xdata = ... # if this is how you use this bit - haven't > needed to change these myself > ax.format_ydata = ... > > I hope that helps, > > Angus. > > -- > AJC McMorland > Post-doctoral research fellow > Neurobiology, University of Pittsburgh |