Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Friedrich Romstedt
2010/10/18 Jonathan Slavin jsla...@cfa.harvard.edu: I'm wondering if there's some relatively automatic way to have the ticklabels to come out in scientific notation for an axis that uses a linear scale (and has a range that warrants scientific notation)?  For example, an axis that goes from 0

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread David Pine
I agree with Jonathan and would very much like to see this feature implemented. The example shown in the thread didn't show the × symbol, however, which would be nice to have -- e.g. it should read 2.0 × 10² rather than 2.0 10². David On Oct 19, 2010, at 1:08 PM, Friedrich Romstedt wrote:

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Friedrich Romstedt
What about inserting \cdot, that's the scientific notation I do prefer? If I'm not mistaken that's what I did that time, might be unreadable in the preview? I checked, when you look close you see the dot in gmane preview. We can make this customisable, with \times as an alternative option.

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread David Pine
I like the times symbol but others prefer the dot (which I missed in the gmane preview!). So I like your suggestion of providing an option to use either \cdot or \times. David On Oct 19, 2010, at 3:23 PM, Friedrich Romstedt wrote: What about inserting \cdot, that's the scientific notation I

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Friedrich Romstedt
2010/10/19 David Pine djp...@gmail.com: I like the times symbol but others prefer the dot (which I missed in the gmane preview!).  So I like your suggestion of providing an option to use either \cdot or \times. Okay, I'll try to look into it next week, is that okay with you both? I don't

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Jonathan Slavin
I think that'd be fine -- i.e. the option of \cdot or \times (though in the gmane preview the dot looks a bit low). In the mean time, I came up with the method below that worked for my purpose. Jon import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import FuncFormatter

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Friedrich Romstedt
2010/10/19 Jonathan Slavin jsla...@cfa.harvard.edu: I think that'd be fine -- i.e. the option of \cdot or \times (though in the gmane preview the dot looks a bit low).  In the mean time, I came up with the method below that worked for my purpose. Okay thx import matplotlib.pyplot as plt

Re: [Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-19 Thread Jonathan Slavin
Friedrich, Our e-mails crossed. I don't think the numbers need to have the same exponent. I would go with (d) as my example does. The more difficult part to my mind is the number of significant digits to use. The current code that determines whether to use an offset or not must look at the

[Matplotlib-users] scientific notation in ticklabels for linear plot

2010-10-18 Thread Jonathan Slavin
Hi, I'm wondering if there's some relatively automatic way to have the ticklabels to come out in scientific notation for an axis that uses a linear scale (and has a range that warrants scientific notation)? For example, an axis that goes from 0 to 2.E18 by default uses the labels 0, 0.5, 1.0,

Re: [Matplotlib-users] scientific notation

2010-07-17 Thread Friedrich Romstedt
2010/7/15 Waléria Antunes David waleriantu...@gmail.com: But, i don't know how do... I tried, but don't, most failed Maybe this is something in the direction you want? You have to adapt the test file. Friedrich embedded_sci_formatter.py Description: Binary data attachment: test.png

Re: [Matplotlib-users] scientific notation

2010-07-16 Thread Waléria Antunes David
Hi... I tried the first option, but failed see my image attached And the second option, i don't understand the variable 'val' ...? On Thu, Jul 15, 2010 at 3:22 PM, Ryan May rma...@gmail.com wrote: On Thu, Jul 15, 2010 at 8:41 AM, Waléria Antunes David waleriantu...@gmail.com wrote: Hi

Re: [Matplotlib-users] scientific notation

2010-07-16 Thread Waléria Antunes David
I forgot of the my image. On Fri, Jul 16, 2010 at 9:10 AM, Waléria Antunes David waleriantu...@gmail.com wrote: Hi... I tried the first option, but failed see my image attached And the second option, i don't understand the variable 'val' ...? On Thu, Jul 15, 2010 at 3:22 PM, Ryan

Re: [Matplotlib-users] scientific notation

2010-07-16 Thread Benjamin Root
Please attach the code you used to generate this image. Ben Root On Fri, Jul 16, 2010 at 7:11 AM, Waléria Antunes David waleriantu...@gmail.com wrote: I forgot of the my image. On Fri, Jul 16, 2010 at 9:10 AM, Waléria Antunes David waleriantu...@gmail.com wrote: Hi... I tried the

[Matplotlib-users] scientific notation

2010-07-15 Thread Waléria Antunes David
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

Re: [Matplotlib-users] scientific notation

2010-07-15 Thread Benjamin Root
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

Re: [Matplotlib-users] scientific notation

2010-07-15 Thread Waléria Antunes David
But, i don't know how do... I tried, but don't, most failed On Thu, Jul 15, 2010 at 11:25 AM, Benjamin Root ben.r...@ou.edu wrote: 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 =

Re: [Matplotlib-users] scientific notation

2010-07-15 Thread Ryan May
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

[Matplotlib-users] scientific notation \times symbol

2009-12-07 Thread Hao Wen
Hi there: I tried to plot large numbers and scientific notation has to be used. But instead of \times symbol, it used e, which cannot be accepted as publishable. Anyone know how to deal with that? My original code is: import matplotlib.pyplot