Overlapping plots

Hi at all,

sometimes I need to overlap time series plots. Basically I want to
achieve something like this:
http://img36.imageshack.us/img36/9501/shot01i.png

To be honest, I don't really know where to start. If I use a single
plotcanvas for each trace, drawing is clipped at the borders of the canvas.

If I use only one canvas for all data, I have to take care of everything
(e.g. positioning without sizers) by myself, which I like to avoid.

So any hint for starting will be fine.

Thanks, Hannes

Are you using pyPlot? Can you just provide an offset to each line to
shift it up by that much?

For something like this, I would probably use matplotlib, which was
developed to plot eeg data. See this page, for example:
http://www.scipy.org/Cookbook/Matplotlib/MultilinePlots

You can then embed your plot into a wxPython applicaion.

Che

···

On Fri, Sep 10, 2010 at 10:26 AM, Hannes Rodla <wxpython-list@m11r.de> wrote:

Hi at all,

sometimes I need to overlap time series plots. Basically I want to
achieve something like this:
ImageShack - Best place for all of your image hosting and image sharing needs

To be honest, I don't really know where to start. If I use a single
plotcanvas for each trace, drawing is clipped at the borders of the canvas.

If I use only one canvas for all data, I have to take care of everything
(e.g. positioning without sizers) by myself, which I like to avoid.

So any hint for starting will be fine.

Hi!

C M schrieb:

Are you using pyPlot?

Right now I'm trying to identify the best way of doing it. :slight_smile:

Can you just provide an offset to each line to
shift it up by that much?

It's not only the plot, there are annotations etc.

For something like this, I would probably use matplotlib, which was
developed to plot eeg data. See this page, for example:
http://www.scipy.org/Cookbook/Matplotlib/MultilinePlots

You can then embed your plot into a wxPython applicaion.

matplotlib is to slow for our datasets (and consumes more memory for
caching, zooming, etc)...

Hannes

Hi!

C M schrieb:

Are you using pyPlot?

Right now I'm trying to identify the best way of doing it. :slight_smile:

Can you just provide an offset to each line to
shift it up by that much?

It's not only the plot, there are annotations etc.

Well, if there are so much "etc" that it really ought to be a fully
separate plot, then maybe make them fully separate plots. There may
be no advantage to overlapping the plotted lines on the y axis; as
long as the x axes are all aligned and y scaling is the same, you
should be able to compare them in terms of size and time of occurrence
of events. I think it might look cleaner, since often that overlap
can obscure the signals, even with color coding.

But if there is not much beyond annotations, and since those
annotations need to be given a position coordinate anyway, can't you
also provide the offset to the annotations (and "etc")? This way
they'd be positioned correctly relative to their line.

matplotlib is to slow for our datasets (and consumes more memory for
caching, zooming, etc)...

I'm a little surprised to hear this (though see below). Matplotlib
was developed for use with eeg data, and I thought your signals was
something like that. You might want to check on their list to make
sure everything is optimized for your data. It may also be that you
can get away with sampling your data to reduce number of points
plotted (I've seen people who want to plot far more points than the
eye/monitor can manage...no reason to do that).

I've recently heard of this plotting library, too, which tries to get
around some of the features which slow down matplotlib:

http://packages.python.org/guiqwt/

Though I think you have to use PyQT as your GUI, instead of wxPython
(though I am not sure).

Che

···

On Tue, Sep 14, 2010 at 3:29 AM, Hannes Rodla <wxpython-list@m11r.de> wrote:

Hannes

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Hi!

C M schrieb:
[...]

Can you just provide an offset to each line to
shift it up by that much?

It's not only the plot, there are annotations etc.

Well, if there are so much "etc" that it really ought to be a fully
separate plot, then maybe make them fully separate plots. There may
be no advantage to overlapping the plotted lines on the y axis; as
long as the x axes are all aligned and y scaling is the same, you
should be able to compare them in terms of size and time of occurrence
of events. I think it might look cleaner, since often that overlap
can obscure the signals, even with color coding.

I don't like this overlapping too, but it's a common display form for
this data (see below).

But if there is not much beyond annotations, and since those
annotations need to be given a position coordinate anyway, can't you
also provide the offset to the annotations (and "etc")? This way
they'd be positioned correctly relative to their line.

I'm afraid that will be the only solution. So I have to keep the amount
of "etc" small. :slight_smile:

matplotlib is to slow for our datasets (and consumes more memory for
caching, zooming, etc)...

I'm a little surprised to hear this (though see below). Matplotlib
was developed for use with eeg data, and I thought your signals was
something like that.

Yes, this is also a time series - but from seismology. So the data can
extend 10 years and 1000 Hz sampling rate (but not at the same time,
then I can blame the user). More common is looking at 10 minutes at 100
Hz at 10 3-component stations.

You might want to check on their list to make
sure everything is optimized for your data. It may also be that you
can get away with sampling your data to reduce number of points
plotted (I've seen people who want to plot far more points than the
eye/monitor can manage...no reason to do that).

From a certain amount of data I use numpy's min/max feature to reduce
data for plotting.

I've recently heard of this plotting library, too, which tries to get
around some of the features which slow down matplotlib:

http://packages.python.org/guiqwt/

Looks quite good!

Though I think you have to use PyQT as your GUI, instead of wxPython
(though I am not sure).

I found some examples for really fast wx plotting in this list, so I
think there's no need to switch to qt.

Hannes