foreground/background img_plot

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

foreground/background img_plot

Barth
Dear all,

I am using chaco plot to create a data analysis tool. For this, we often have to plot several datasets in one plot. 

If this does not make any problem with LinePlot, with ImagePlot it is not so straightforward: the latest plot will always mask the others. 
How can i do to select which ImagePlot is drawn on top of the others ? 

The code i am using is: 

plot = ToolbarPlot(self.plotdata, toolbar_class=additional_buttons.MyPlotToolbar, hiding=False, auto_hide=False)


newplot_1=plot.img_plot(z_name1,name = plotname1,xbounds = (x0_1, x1_1),ybounds = (y0_1, y1_1),colormap = jet)

newplot_2=plot.img_plot(z_name2,name = plotname2,xbounds = (x0_2, x1_2),ybounds = (y0_2, y1_2),colormap = jet)


In this way, newplot2 will mask newplot1. Is there a way to make such that newplot_1 masks newplot_2 ? 




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

Re: foreground/background img_plot

Sam Wedge

Hi Pierre,

 

I hope the code below helps:

 

#Plot your images as usual, something like:

plot.img_plot("image1data")

plot.img_plot("image2data")

 

#You can choose to display the first with:

plot.plots['plot0'][0].visible = True

plot.plots['plot1'][0].visible = False

 

#or the second with:

plot.plots['plot0'][0].visible = False

plot.plots['plot1'][0].visible = True

 

 

 

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Pierre Barthelemy
Sent: 31 May 2012 10:07
To: [hidden email]
Subject: [Enthought-Dev] foreground/background img_plot

 

Dear all,

 

I am using chaco plot to create a data analysis tool. For this, we often have to plot several datasets in one plot. 

 

If this does not make any problem with LinePlot, with ImagePlot it is not so straightforward: the latest plot will always mask the others. 

How can i do to select which ImagePlot is drawn on top of the others ? 

 

The code i am using is: 

 

plot = ToolbarPlot(self.plotdata, toolbar_class=additional_buttons.MyPlotToolbar, hiding=False, auto_hide=False)

 

 

newplot_1=plot.img_plot(z_name1,name = plotname1,xbounds = (x0_1, x1_1),ybounds = (y0_1, y1_1),colormap = jet)

 

newplot_2=plot.img_plot(z_name2,name = plotname2,xbounds = (x0_2, x1_2),ybounds = (y0_2, y1_2),colormap = jet)

 

 

In this way, newplot2 will mask newplot1. Is there a way to make such that newplot_1 masks newplot_2 ? 

 

 

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


*****Disclaimer************
This email and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only. If
you are not a named addressee, you must not use, retain or
disclose such information.

Serco cannot guarantee that the email or any attachments are free
from viruses.
The views expressed in this email are those of the originator and
do not necessarily represent the views of Serco.

Nothing in this email shall bind Serco in any contract or
obligation.

Please note that all email messages sent to Serco are subject to
monitoring / interception for lawful business purposes.

Serco Group plc. Registered in England and Wales. No: 2048608
Registered Office: Serco House, 16 Bartley Wood Business Park,
Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
*****End Disclaimer********


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

Re: foreground/background img_plot

Corran Webster
Hi Pierre,

you can also change the display order by manipulating the components attribute of the plot - this is what determines which components are drawn in what order - there are a series of methods on the base Enable Container class for doing this sort of thing: raise_component and lower_component being the obvious ones, but more complex interactions being possible with remove() and insert():

eg.

plot.img_plot("image1", name='image_plot1')
plot.img_plot("image2", name='image_plot2')

# raise up the second plot
image_plot2 = plot.plots['image_plot2'][0]
plot.raise_component(image_plot2)

# lower it back down
plot.lower_component(image_plot2)

# put it into the nth layer (counting from 0)
plot.remove(image_plot2)
plot.insert(n, image_plot2)

(Un-tested code, but it should work modulo typos).

-- Corran

On Thu, May 31, 2012 at 4:26 AM, Sam Wedge <[hidden email]> wrote:

Hi Pierre,

 

I hope the code below helps:

 

#Plot your images as usual, something like:

plot.img_plot("image1data")

plot.img_plot("image2data")

 

#You can choose to display the first with:

plot.plots['plot0'][0].visible = True

plot.plots['plot1'][0].visible = False

 

#or the second with:

plot.plots['plot0'][0].visible = False

plot.plots['plot1'][0].visible = True

 

 

 

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Pierre Barthelemy
Sent: 31 May 2012 10:07
To: [hidden email]
Subject: [Enthought-Dev] foreground/background img_plot

 

Dear all,

 

I am using chaco plot to create a data analysis tool. For this, we often have to plot several datasets in one plot. 

 

If this does not make any problem with LinePlot, with ImagePlot it is not so straightforward: the latest plot will always mask the others. 

How can i do to select which ImagePlot is drawn on top of the others ? 

 

The code i am using is: 

 

plot = ToolbarPlot(self.plotdata, toolbar_class=additional_buttons.MyPlotToolbar, hiding=False, auto_hide=False)

 

 

newplot_1=plot.img_plot(z_name1,name = plotname1,xbounds = (x0_1, x1_1),ybounds = (y0_1, y1_1),colormap = jet)

 

newplot_2=plot.img_plot(z_name2,name = plotname2,xbounds = (x0_2, x1_2),ybounds = (y0_2, y1_2),colormap = jet)

 

 

In this way, newplot2 will mask newplot1. Is there a way to make such that newplot_1 masks newplot_2 ? 

 

 

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


*****Disclaimer************
This email and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only. If
you are not a named addressee, you must not use, retain or
disclose such information.

Serco cannot guarantee that the email or any attachments are free
from viruses.
The views expressed in this email are those of the originator and
do not necessarily represent the views of Serco.

Nothing in this email shall bind Serco in any contract or
obligation.

Please note that all email messages sent to Serco are subject to
monitoring / interception for lawful business purposes.

Serco Group plc. Registered in England and Wales. No: 2048608
Registered Office: Serco House, 16 Bartley Wood Business Park,
Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
*****End Disclaimer********


_______________________________________________
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: foreground/background img_plot

Barth
Thanks a lot for these answers. I will implement them asap... 

On Thu, May 31, 2012 at 5:04 PM, Corran Webster <[hidden email]> wrote:
Hi Pierre,

you can also change the display order by manipulating the components attribute of the plot - this is what determines which components are drawn in what order - there are a series of methods on the base Enable Container class for doing this sort of thing: raise_component and lower_component being the obvious ones, but more complex interactions being possible with remove() and insert():

eg.

plot.img_plot("image1", name='image_plot1')
plot.img_plot("image2", name='image_plot2')

# raise up the second plot
image_plot2 = plot.plots['image_plot2'][0]
plot.raise_component(image_plot2)

# lower it back down
plot.lower_component(image_plot2)

# put it into the nth layer (counting from 0)
plot.remove(image_plot2)
plot.insert(n, image_plot2)

(Un-tested code, but it should work modulo typos).

-- Corran

On Thu, May 31, 2012 at 4:26 AM, Sam Wedge <[hidden email]> wrote:

Hi Pierre,

 

I hope the code below helps:

 

#Plot your images as usual, something like:

plot.img_plot("image1data")

plot.img_plot("image2data")

 

#You can choose to display the first with:

plot.plots['plot0'][0].visible = True

plot.plots['plot1'][0].visible = False

 

#or the second with:

plot.plots['plot0'][0].visible = False

plot.plots['plot1'][0].visible = True

 

 

 

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Pierre Barthelemy
Sent: 31 May 2012 10:07
To: [hidden email]
Subject: [Enthought-Dev] foreground/background img_plot

 

Dear all,

 

I am using chaco plot to create a data analysis tool. For this, we often have to plot several datasets in one plot. 

 

If this does not make any problem with LinePlot, with ImagePlot it is not so straightforward: the latest plot will always mask the others. 

How can i do to select which ImagePlot is drawn on top of the others ? 

 

The code i am using is: 

 

plot = ToolbarPlot(self.plotdata, toolbar_class=additional_buttons.MyPlotToolbar, hiding=False, auto_hide=False)

 

 

newplot_1=plot.img_plot(z_name1,name = plotname1,xbounds = (x0_1, x1_1),ybounds = (y0_1, y1_1),colormap = jet)

 

newplot_2=plot.img_plot(z_name2,name = plotname2,xbounds = (x0_2, x1_2),ybounds = (y0_2, y1_2),colormap = jet)

 

 

In this way, newplot2 will mask newplot1. Is there a way to make such that newplot_1 masks newplot_2 ? 

 

 

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


*****Disclaimer************
This email and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only. If
you are not a named addressee, you must not use, retain or
disclose such information.

Serco cannot guarantee that the email or any attachments are free
from viruses.
The views expressed in this email are those of the originator and
do not necessarily represent the views of Serco.

Nothing in this email shall bind Serco in any contract or
obligation.

Please note that all email messages sent to Serco are subject to
monitoring / interception for lawful business purposes.

Serco Group plc. Registered in England and Wales. No: 2048608
Registered Office: Serco House, 16 Bartley Wood Business Park,
Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
*****End Disclaimer********


_______________________________________________
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



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