John Hunter wrote: > On Sat, Aug 30, 2008 at 4:13 PM, Xavier Gnata <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I'm using the TkAgg backend. It is nice and fine except one issue: >> >> Here is a trivial testcase: >> >> import pylab >> import numpy >> >> M=numpy.zeros((2000,2000)) >> pylab.imshow(M) >> >> The cursor position is displayed this way: x=1.23e03 y=1.72e03 (in right >> corner of the window) >> It should be formated as intergers and not as floats. >> >> It is not only cosmetics because with 1.23e03, we are missing the last >> digit (it matters in my usecase and anyhow it is q bit stupid). >> >> The fix should be trivial but I have to find the line of interest... >> > > The x and y toolbar coordinate formatting are controlled by a pair of > functions, fmt_xdata and fmt_ydata. You can set them to be anything > you like, eg for integer formatting: > > def format_int(pylab.imshow(M)x): > return '%d'%int(x) > > ax.fmt_xdata = format_int > > > JDH > Ok thanks it does the job. However, I think it should really be done by default. self.xaxis.major.formatter.set_scientific(sb) is not the best way to display pixel numbers (IMHO).
Xavier ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
