Chaco multiple axis

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Chaco multiple axis

Boiteux, Benoit

Hello,

 

With Chaco,

I manage to have 2 Y-axis (left and right) on my plot to draw curves with different units.

Now, I would like to have a 3rd Y-axis to draw another curves with another units.

Is it possible to have 2 y-axis on the left with chaco ? (I don’t manage..)

 

Thanks

Benoit

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

bryce hendrix-2
On 5/31/2010 7:12 AM, Boiteux, Benoit wrote:

Hello,

 

With Chaco,

I manage to have 2 Y-axis (left and right) on my plot to draw curves with different units.

Now, I would like to have a 3rd Y-axis to draw another curves with another units.

Is it possible to have 2 y-axis on the left with chaco ? (I don’t manage..)


Nope, unfortunately not. For now, the only hack I can think of if to put an axis in a Container and put it next to the plot.

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Peter Wang
In reply to this post by Boiteux, Benoit
On Mon, May 31, 2010 at 6:12 AM, Boiteux, Benoit
<[hidden email]> wrote:
> Hello,
> With Chaco,
> I manage to have 2 Y-axis (left and right) on my plot to draw curves with
> different units.
>
> Now, I would like to have a 3rd Y-axis to draw another curves with another
> units.
>
> Is it possible to have 2 y-axis on the left with chaco ? (I don’t manage..)

Check out the multi-axis example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/multiaxis.py

If you are using the Plot object, you can look at this modification on
the above example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/multiaxis_using_Plot.py

-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Boiteux, Benoit
Hi Peter,
Thanks for the links.
However, I don't need 2 Y-axis, I need 3 :)
I'm going to try to create a container with the 3rd axis only as Bryce suggested.

Thanks
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Monday, May 31, 2010 10:22 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco multiple axis

On Mon, May 31, 2010 at 6:12 AM, Boiteux, Benoit
<[hidden email]> wrote:
> Hello,
> With Chaco,
> I manage to have 2 Y-axis (left and right) on my plot to draw curves with
> different units.
>
> Now, I would like to have a 3rd Y-axis to draw another curves with another
> units.
>
> Is it possible to have 2 y-axis on the left with chaco ? (I don't manage..)

Check out the multi-axis example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/multiaxis.py

If you are using the Plot object, you can look at this modification on
the above example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/multiaxis_using_Plot.py

-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Brennan Williams
Boiteux, Benoit wrote:
> Hi Peter,
> Thanks for the links.
> However, I don't need 2 Y-axis, I need 3 :)
> I'm going to try to create a container with the 3rd axis only as Bryce suggested.
>
>  
this would be a useful addition to the Chaco plot examples

Brennan

> Thanks
> Benoit
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
> Sent: Monday, May 31, 2010 10:22 PM
> To: [hidden email]
> Subject: Re: [Enthought-Dev] Chaco multiple axis
>
> On Mon, May 31, 2010 at 6:12 AM, Boiteux, Benoit
> <[hidden email]> wrote:
>  
>> Hello,
>> With Chaco,
>> I manage to have 2 Y-axis (left and right) on my plot to draw curves with
>> different units.
>>
>> Now, I would like to have a 3rd Y-axis to draw another curves with another
>> units.
>>
>> Is it possible to have 2 y-axis on the left with chaco ? (I don't manage..)
>>    
>
> Check out the multi-axis example:
> https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/multiaxis.py
>
> If you are using the Plot object, you can look at this modification on
> the above example:
> https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/multiaxis_using_Plot.py
>
> -Peter
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>  


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

bryce hendrix-2
Quoting Brennan Williams <[hidden email]>:

> Boiteux, Benoit wrote:
>> Hi Peter,
>> Thanks for the links.
>> However, I don't need 2 Y-axis, I need 3 :)
>> I'm going to try to create a container with the 3rd axis only as  
>> Bryce suggested.
>>
>>
> this would be a useful addition to the Chaco plot examples

Are you offering? :)

In my opinion, the axis support code needs a bit of a refactor. The  
current implementation is pretty rigid in in where axis are layed out,  
which doesn't make it easy to add another axis. A more flexible  
solution would be to keep the axis and labels in separate containers  
and make the Plot class actually be a composition of several  
containers where the plot is in the center.

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Peter Wang
In reply to this post by Boiteux, Benoit
On Tue, Jun 1, 2010 at 2:17 AM, Boiteux, Benoit
<[hidden email]> wrote:
> Hi Peter,
> Thanks for the links.
> However, I don't need 2 Y-axis, I need 3 :)
> I'm going to try to create a container with the 3rd axis only as Bryce suggested.

Ah, my bad.  I was thinking of this example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/stacked_axis.py

Screenshot is attached.

-Peter

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

stacked_axis.png (170K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Boiteux, Benoit
That's very interesting, I'm going to use this example.

Thanks Peter !
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Tuesday, June 01, 2010 4:19 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco multiple axis

On Tue, Jun 1, 2010 at 2:17 AM, Boiteux, Benoit <[hidden email]> wrote:
> Hi Peter,
> Thanks for the links.
> However, I don't need 2 Y-axis, I need 3 :) I'm going to try to create
> a container with the 3rd axis only as Bryce suggested.

Ah, my bad.  I was thinking of this example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/stacked_axis.py

Screenshot is attached.

-Peter
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Boiteux, Benoit
In reply to this post by Peter Wang
Hi Peter,

I used this example (stacked axis) to try to make something similar and separate y-axis from plot area into an HPlotContainer.
Ex:
container = HPlotContainer(padding_left=10,padding_right=20, bgcolor="white")
container.add(vertical_axis)
container.add(plot_area)

where plot_area is an OverlayPlotContainer containing line plot
and
vertical_axis =  PlotAxis(orientation='left',
                             mapper= plot_area.plot.value_mapper,
                             bgcolor="transparent",
                             title='Y-Axis',
                             border_visible = True,)
vertical_axis.width = 60
vertical_axis.padding_left = 10
vertical_axis.padding_right = 10

Then,
Container is displayed with a View by editing it with a : editor = ComponentEditor()

In my case, I only see plot area, no Y-axis..
When I'm debugging, I can see container has 2 components (PlotAxis and OverlayPlotContainer, as expected).

Is anything to check on my side ?
Thanks
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Tuesday, June 01, 2010 4:19 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco multiple axis

On Tue, Jun 1, 2010 at 2:17 AM, Boiteux, Benoit <[hidden email]> wrote:
> Hi Peter,
> Thanks for the links.
> However, I don't need 2 Y-axis, I need 3 :) I'm going to try to create
> a container with the 3rd axis only as Bryce suggested.

Ah, my bad.  I was thinking of this example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/stacked_axis.py

Screenshot is attached.

-Peter
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco multiple axis

Boiteux, Benoit
Hi again,

I also tried GridPlotContainer (with shape = (2,1))
In this case I see y-axis only, no plot area...
If I put shape (1,1) I see the plot.
That's crazy.
Is there a magical formula to make plot and axis appear at the same time ? ^^

Thanks
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Boiteux, Benoit
Sent: Tuesday, June 22, 2010 11:08 AM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco multiple axis

Hi Peter,

I used this example (stacked axis) to try to make something similar and separate y-axis from plot area into an HPlotContainer.
Ex:
container = HPlotContainer(padding_left=10,padding_right=20, bgcolor="white")
container.add(vertical_axis)
container.add(plot_area)

where plot_area is an OverlayPlotContainer containing line plot
and
vertical_axis =  PlotAxis(orientation='left',
                             mapper= plot_area.plot.value_mapper,
                             bgcolor="transparent",
                             title='Y-Axis',
                             border_visible = True,)
vertical_axis.width = 60
vertical_axis.padding_left = 10
vertical_axis.padding_right = 10

Then,
Container is displayed with a View by editing it with a : editor = ComponentEditor()

In my case, I only see plot area, no Y-axis..
When I'm debugging, I can see container has 2 components (PlotAxis and OverlayPlotContainer, as expected).

Is anything to check on my side ?
Thanks
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Tuesday, June 01, 2010 4:19 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco multiple axis

On Tue, Jun 1, 2010 at 2:17 AM, Boiteux, Benoit <[hidden email]> wrote:
> Hi Peter,
> Thanks for the links.
> However, I don't need 2 Y-axis, I need 3 :) I'm going to try to create
> a container with the 3rd axis only as Bryce suggested.

Ah, my bad.  I was thinking of this example:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/stacked_axis.py

Screenshot is attached.

-Peter
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev