On 4/10/07, Iyer <[EMAIL PROTECTED]> wrote:

> If only someone could guide me, so that I can
> understand better how to "translate" the ticks from
> the default "number of sample" ticks to that of
> different ticks - say
> new_ticks=original_ticks/(some_constant). Right now
> I'm clueless, your input will help a lot in
> understanding Mpl.


OK, your persistence is admirable.  You are still asking the wrong
question and applying the wrong solution, but dog-golly, you've earned
the right to do it the wrong way!

from matplotlib.ticker import FuncFormatter

def myformatter(x, pos=None):
     return '%1.3f'%(x/4.)

ax = subplot(111)
ax.plot(x, y)
ax.xaxis.set_major_formatter(FuncFormatter(myformatter))

Now all your ticks are magically divided by 4.

But really, simply scaling your x input data is the way to go.  If we
want to move this conversation forward, you should try instead

  plot(x/4, y)

and then explain as clearly as possibly this doesn't do what you want.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to