create_scatter_plot severely slows plot

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

create_scatter_plot severely slows plot

Nicholas Earl
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

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

Re: create_scatter_plot severely slows plot

sergey miryanov

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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: create_scatter_plot severely slows plot

Nicholas Earl
Thanks, Sergey.

A lot of my program is built around the create_line_plot() object, but the ScatterLinePlot seems to use/have different functions. Is there a way to use the ZoomTool with the ScatterLinePlot? I apologize, I'm a bit new to Chaco.

Thanks!

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 13, 2013 at 8:08 PM, sergey miryanov <[hidden email]> wrote:

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: create_scatter_plot severely slows plot

sergey miryanov
Hi, Nicholas!

ScatterLinePlot is just a LinePlot with addition drawing of markers. So all tools and overlays should work with it.

Regards, Sergey.


On Sun, Sep 15, 2013 at 2:07 PM, Nicholas Earl <[hidden email]> wrote:
Thanks, Sergey.

A lot of my program is built around the create_line_plot() object, but the ScatterLinePlot seems to use/have different functions. Is there a way to use the ZoomTool with the ScatterLinePlot? I apologize, I'm a bit new to Chaco.

Thanks!

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 13, 2013 at 8:08 PM, sergey miryanov <[hidden email]> wrote:

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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



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

Re: create_scatter_plot severely slows plot

Nicholas Earl
Sorry to bother again, but I'm still having trouble getting it to mesh with the tools I had before. I guess I should first ask: how does the data need to be packaged when defining an instance of the class? Should I be using ArrayPlotData?

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Mon, Sep 16, 2013 at 10:08 PM, sergey miryanov <[hidden email]> wrote:
Hi, Nicholas!

ScatterLinePlot is just a LinePlot with addition drawing of markers. So all tools and overlays should work with it.

Regards, Sergey.


On Sun, Sep 15, 2013 at 2:07 PM, Nicholas Earl <[hidden email]> wrote:
Thanks, Sergey.

A lot of my program is built around the create_line_plot() object, but the ScatterLinePlot seems to use/have different functions. Is there a way to use the ZoomTool with the ScatterLinePlot? I apologize, I'm a bit new to Chaco.

Thanks!

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 13, 2013 at 8:08 PM, sergey miryanov <[hidden email]> wrote:

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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



_______________________________________________
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: create_scatter_plot severely slows plot

Adam Hughes
You should use ArrayPlotData.  If your plot is slow, is may be because you are creating new plots with each iteration, rather than updating the lines properly.  Ideally, you need to get your data into an ArrayPlotData object, which for all intents and purposes, is a dictionary that maps a string key to a 1-d numpy array.  ArrayPlotData is especially useful for changing data dynamically, as it triggers downstream events in Chaco that redraw the plot in an optimized way.  

If you paste your code, I can try to help you with the specifics.



On Fri, Sep 20, 2013 at 1:30 PM, Nicholas Earl <[hidden email]> wrote:
Sorry to bother again, but I'm still having trouble getting it to mesh with the tools I had before. I guess I should first ask: how does the data need to be packaged when defining an instance of the class? Should I be using ArrayPlotData?

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Mon, Sep 16, 2013 at 10:08 PM, sergey miryanov <[hidden email]> wrote:
Hi, Nicholas!

ScatterLinePlot is just a LinePlot with addition drawing of markers. So all tools and overlays should work with it.

Regards, Sergey.


On Sun, Sep 15, 2013 at 2:07 PM, Nicholas Earl <[hidden email]> wrote:
Thanks, Sergey.

A lot of my program is built around the create_line_plot() object, but the ScatterLinePlot seems to use/have different functions. Is there a way to use the ZoomTool with the ScatterLinePlot? I apologize, I'm a bit new to Chaco.

Thanks!

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 13, 2013 at 8:08 PM, sergey miryanov <[hidden email]> wrote:

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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



_______________________________________________
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




--
Adam Hughes
Physics Ph.D Candidate
George Washington University

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

Re: create_scatter_plot severely slows plot

Nicholas Earl
Wow, thanks, that'd be fantastic. I have a class name MultiPlot where I dump in a handful of plots (line and scatter generally) that get added to a container, then I call the container object to render the plots in a traits ui. I do think I've been just creating plots with each iteration.

Any advice or guidance would be wonderful, here is the code: http://pastebin.com/yc2TFnhW

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 20, 2013 at 10:59 AM, Adam Hughes <[hidden email]> wrote:
You should use ArrayPlotData.  If your plot is slow, is may be because you are creating new plots with each iteration, rather than updating the lines properly.  Ideally, you need to get your data into an ArrayPlotData object, which for all intents and purposes, is a dictionary that maps a string key to a 1-d numpy array.  ArrayPlotData is especially useful for changing data dynamically, as it triggers downstream events in Chaco that redraw the plot in an optimized way.  

If you paste your code, I can try to help you with the specifics.



On Fri, Sep 20, 2013 at 1:30 PM, Nicholas Earl <[hidden email]> wrote:
Sorry to bother again, but I'm still having trouble getting it to mesh with the tools I had before. I guess I should first ask: how does the data need to be packaged when defining an instance of the class? Should I be using ArrayPlotData?

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Mon, Sep 16, 2013 at 10:08 PM, sergey miryanov <[hidden email]> wrote:
Hi, Nicholas!

ScatterLinePlot is just a LinePlot with addition drawing of markers. So all tools and overlays should work with it.

Regards, Sergey.


On Sun, Sep 15, 2013 at 2:07 PM, Nicholas Earl <[hidden email]> wrote:
Thanks, Sergey.

A lot of my program is built around the create_line_plot() object, but the ScatterLinePlot seems to use/have different functions. Is there a way to use the ZoomTool with the ScatterLinePlot? I apologize, I'm a bit new to Chaco.

Thanks!

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 13, 2013 at 8:08 PM, sergey miryanov <[hidden email]> wrote:

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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



_______________________________________________
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




--
Adam Hughes
Physics Ph.D Candidate
George Washington University

_______________________________________________
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: create_scatter_plot severely slows plot

Nicholas Earl
Thanks for your help guys. I was able to get it to work semi-properly. However, for whatever reason the markers on the ScatterLinePlot do not stay within the subcontainer, and "leak" over into other containers. Also, I'm not really seeing much of a speed up. With a medium-large data set, it slows the plot to a crawl.

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 20, 2013 at 1:47 PM, Nicholas Earl <[hidden email]> wrote:
Wow, thanks, that'd be fantastic. I have a class name MultiPlot where I dump in a handful of plots (line and scatter generally) that get added to a container, then I call the container object to render the plots in a traits ui. I do think I've been just creating plots with each iteration.

Any advice or guidance would be wonderful, here is the code: http://pastebin.com/yc2TFnhW

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 20, 2013 at 10:59 AM, Adam Hughes <[hidden email]> wrote:
You should use ArrayPlotData.  If your plot is slow, is may be because you are creating new plots with each iteration, rather than updating the lines properly.  Ideally, you need to get your data into an ArrayPlotData object, which for all intents and purposes, is a dictionary that maps a string key to a 1-d numpy array.  ArrayPlotData is especially useful for changing data dynamically, as it triggers downstream events in Chaco that redraw the plot in an optimized way.  

If you paste your code, I can try to help you with the specifics.



On Fri, Sep 20, 2013 at 1:30 PM, Nicholas Earl <[hidden email]> wrote:
Sorry to bother again, but I'm still having trouble getting it to mesh with the tools I had before. I guess I should first ask: how does the data need to be packaged when defining an instance of the class? Should I be using ArrayPlotData?

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Mon, Sep 16, 2013 at 10:08 PM, sergey miryanov <[hidden email]> wrote:
Hi, Nicholas!

ScatterLinePlot is just a LinePlot with addition drawing of markers. So all tools and overlays should work with it.

Regards, Sergey.


On Sun, Sep 15, 2013 at 2:07 PM, Nicholas Earl <[hidden email]> wrote:
Thanks, Sergey.

A lot of my program is built around the create_line_plot() object, but the ScatterLinePlot seems to use/have different functions. Is there a way to use the ZoomTool with the ScatterLinePlot? I apologize, I'm a bit new to Chaco.

Thanks!

Nicholas Earl
Graduate Research Assistant
San Diego State University


On Fri, Sep 13, 2013 at 8:08 PM, sergey miryanov <[hidden email]> wrote:

Try to look this. https://github.com/sergey-miryanov/chaco/blob/master/chaco/ScatterLinePlot.py It may be a bit outdated but main idea is clear. We still use this approach.

13.09.2013 23:09 пользователь "Nicholas Earl" <[hidden email]> написал:
Hello all,

I'm having an issue where I need a line plot with data points. I figured the most obvious way would be to use both create_scatter_plot and create_line_plot with the same data. It looks fine, but the performance decreases greatly. I've tried just creating two line plots to see if perhaps it's that I'm using too many data points, but the performance seems fine with the two line plots.

Does anyone have an idea of what could be causing this tremendous slow down, or of a more efficient way to show a set of data as a line with data points?

Thanks for your time and effort!

Nicholas Earl
Graduate Research Assistant
San Diego State University

_______________________________________________
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



_______________________________________________
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




--
Adam Hughes
Physics Ph.D Candidate
George Washington University

_______________________________________________
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