On Thu, May 31, 2012 at 9:31 AM, Mark Bakker <markbak@gmail.com> wrote:
I looked at the example of overriding the default reporting of coords, which is here:

from pylab import *

def millions(x):
return '$%1.1fM' % (x*1e-6)

x = rand(20)
y = 1e7*rand(20)

ax = subplot(111)
ax.fmt_ydata = millions
plot(x, y, 'o')


I don't understand what the millions function does (with a $ and M ?).
In fact, I get the exact same result when I delete the line

ax.fmt_ydata = millions

Any thoughts?

Hi Mark,

It's a bit confusing, but there's actually two different types of formatters. You're most likely looking for major/minor tick formatters (example). In the above example, the *cursor coordinate* is reformatted. In an interactive window, you should see the current cursor position in the lower left (this may depend on the backend)---that's the value that should be reformatted by the `millions` function.