semilogy question

Hi guys.
I'm just a newbie at matplotlib. I couldn't find the answer on my quistion in project's docs.
I've wrote the following code:
from pylab import *
semilogy([1, 5, 2, 3, 1, 6], basey=2)
show()

It works OK but I'd like to see usual decimal numbers instead of 2^0, 2^1, 2^2 ... on y axis.
How can I do that?
Thnx.

A simple solution would be:

numbers, text = yticks()
mytext = [‘%.2f’ % n for n in numbers]
yticks(numbers, mytext)

If you need fancier formatting look at Ticker and Formatter API
http://matplotlib.sourceforge.net/matplotlib.ticker.html

For sure there’s something about this in the examples as well.

Best! Bernhard

···

On 10/23/07, pythonprogrammer@…337… <pythonprogrammer@…337…> wrote:

Hi guys.
I’m just a newbie at matplotlib. I couldn’t find the answer on my
quistion in project’s docs.
I’ve wrote the following code:
from pylab import *
semilogy([1, 5, 2, 3, 1, 6], basey=2)

show()

It works OK but I’d like to see usual decimal numbers instead of 2^0,
2^1, 2^2 … on y axis.
How can I do that?
Thnx.


This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users