Hi all
How can I change the default behavior of the tick labeling from say
1 2 3 4 x1e-5
to
1e-5 2e-5 3e-5 4e-5 ?
My thesis supervisor wants it that way
cheers,
steve
···
--
Random number generation is the art of producing pure gibberish as quickly as possible.
There is problably a better way, but onne way is to set the label formatter yourself:
import pylab
import matplotlib
pylab.plot([1.0E-5,2.5E-5,3.0E-5], [1.0, 3.0, 2.0])
ax = pylab.gca()
ax.xaxis.set_major_formatter(
matplotlib.ticker.FormatStrForm
atter(‘%g’))
pylab.show()
You can craft an arbitrarily constructed string by using matplotlib.ticker.FuncFormatter
instead of matplotlib.ticker.FormatStrFormatter.
Hope this helps,
Alex
···
On 8/3/06, Steve Schmerler <elcorto@…361…> wrote:
Hi all
How can I change the default behavior of the tick labeling from say
1 2 3 4 x1e-5
to
1e-5 2e-5 3e-5 4e-5 ?
My thesis supervisor wants it that way
cheers,
steve
Use OldScalarFormatter instead.
···
On Thursday 03 August 2006 11:59, Alexander Michael wrote:
On 8/3/06, Steve Schmerler <elcorto@...361...> wrote:
> Hi all
>
> How can I change the default behavior of the tick labeling from say
>
> 1 2 3 4 x1e-5
>
> to
>
> 1e-5 2e-5 3e-5 4e-5 ?
>
> My thesis supervisor wants it that way
>
> cheers,
> steve
There is problably a better way, but onne way is to set the label
formatter yourself:
import pylab
import matplotlib
pylab.plot([1.0E-5,2.5E-5,3.0E-5], [1.0, 3.0, 2.0])
ax = pylab.gca()
ax.xaxis.set_major_formatter(
matplotlib.ticker.FormatStrFormatter('%g'))