Re: [Matplotlib-users] Double y-axis with the same 0

2010-07-23 Thread Daniele Padula
I solved the problem and I'm going to explain the solution I used, it can be useful for someone. y data for each series are contained into 2 different arrays, say y1 and y2. The code is the sequent: if max(y1) max(y2): y_max = max(y1) else: y_max = max(y2) if min(y1) min(y2):

Re: [Matplotlib-users] Double y-axis with the same 0

2010-07-21 Thread Thøger Emil Juul Thorsen
That really depends on what you want to do. For one single graph with these specific values, it is quick and easy and hence very satisfying *if that is what you need*. No need to go across the river for water. But, Daniele came up with a different and more sturdy solution (that I have used in

Re: [Matplotlib-users] Double y-axis with the same 0

2010-07-20 Thread Thøger Emil Juul Thorsen
One way is to specify the axes manually, e.g. setting: (with matyplotlib.pyplot importad as plt:) plt.axis([200, 500, -600, 600]) ...or whatever seems fitting for you, and do that on both of the y axes. That should align them nicely. On Sat, 2010-07-17 at 20:37 +0200, Daniele Padula wrote: Hi

Re: [Matplotlib-users] Double y-axis with the same 0

2010-07-20 Thread Benjamin Root
Somehow, this doesn't seem very satisfying. It is almost accidental. There has to be a better way to do this. Ben Root 2010/7/20 Thøger Emil Juul Thorsen thoe...@fys.ku.dk One way is to specify the axes manually, e.g. setting: (with matyplotlib.pyplot importad as plt:) plt.axis([200,

[Matplotlib-users] Double y-axis with the same 0

2010-07-19 Thread Daniele Padula
Hi everybody, I have a problem with a plot. I attach a figure to be easily understandable. As you can see from the figure, I have in the same area a line and a bar plot. The problem is that y=0 for right y axis is different with respect to left y axis one. I want the two y=0 to be the same.