Re: [Matplotlib-users] Symmetrical Log Scale on Axis

2011-08-22 Thread Michael Droettboom

You want to call set_yscale('symlog') on the axes.

Mike

On 08/19/2011 01:07 PM, Jonny Milliken wrote:

Hi,

I am having some trouble establishing how to use 
matplotlib.scale.SymmetricalLogScale() to draw a log scale on the 
positive and negative axis of a plot. Assuming of course that is the 
correct way to go about it


The code at the moment I am looking at goes something like this, with 
arbitrary data generated. I need SubplotHost for parasite axis later on.




import matplotlib
import pylab
import numpy
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost

fig = pylab.figure(1)
main = SubplotHost(fig,111)
fig.add_subplot(main)

x,y = []
for i in range(100):

y.append(numpy.random.rand())
y.append(-numpy.random.rand())
y.append(numpy.random.rand() * 100)
y.append(-numpy.random.rand() * 100)


x = range(len(y))

main.plot(x,y)



At this point I was expecting to be able to run with 
SymmetricalLogScale in the same way main.set_yscale('log') transforms 
after the plot but could not work out how to transform it other than:



main.yaxis = matplotlib.scale.SymmetricalLogScale(main.yaxis)


But that obviously didnt work, since SymmetricalLogScale doesnt have 
get_scale


If anyone could shed some light on the way to invoke this I'd be much 
obliged!? I havent been able to find an example of it's usage anywhere


Cheers

Jonny


--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Symmetrical Log Scale on Axis

2011-08-19 Thread Jonny Milliken
Hi,

I am having some trouble establishing how to use
matplotlib.scale.SymmetricalLogScale() to draw a log scale on the positive
and negative axis of a plot. Assuming of course that is the correct way to
go about it

The code at the moment I am looking at goes something like this, with
arbitrary data generated. I need SubplotHost for parasite axis later on.



import matplotlib
import pylab
import numpy
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost

fig = pylab.figure(1)
main = SubplotHost(fig,111)
fig.add_subplot(main)

x,y = []
for i in range(100):

y.append(numpy.random.rand())
y.append(-numpy.random.rand())
y.append(numpy.random.rand() * 100)
y.append(-numpy.random.rand() * 100)


x = range(len(y))

main.plot(x,y)



At this point I was expecting to be able to run with SymmetricalLogScale in
the same way main.set_yscale('log') transforms after the plot but could not
work out how to transform it other than:


main.yaxis = matplotlib.scale.SymmetricalLogScale(main.yaxis)


But that obviously didnt work, since SymmetricalLogScale doesnt have
get_scale

If anyone could shed some light on the way to invoke this I'd be much
obliged!? I havent been able to find an example of it's usage anywhere

Cheers

Jonny
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users