On Thu, Jul 15, 2010 at 8:41 AM, Waléria Antunes David <
waleriantu...@gmail.com> wrote:
> Hi all,
>
> I have a code base so that:
>
>
> from pylab import *
> x = arange (3000,3400)
> y = -108 * (3.0e14 ** 2)/x**2
>
> pylab..title("Teste")
> pylab.savefig("imagem.png")
> plot(x, y)
>
>
> Well.... the values of the function range(3000,3400) are in Hz......i need
> to pass GHz which would be in scientific notation as follows bellow:
>
> 3000 Hz = 3,0 × 10-6 GHz
> 3400 Hz = 3,4 x 10-6 Ghz
>
> How do I make the graph x-axis is shown in figures
> scientific notation, for this currently so
>
> 3000,3050,3100,....,3400
>
> in scientific notation is: (3.0e-6, 3.4e-6)
>
> Can someone help me?
>
> See my attachment....
>
> I need to show this values in scientific notation......
>
> Waléria
>
>
>
Waleria,
I believe you are looking to use the ticker API. Particularly the
FormatStrFormatter that accepts a sprintf()-like format string to express
your tick values. For your particular example, --off the top of my head--
the string format would be "%.1e".
http://matplotlib.sourceforge.net/api/ticker_api.html
I hope this helps.
Ben Root
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users