PDA

View Full Version : How do I plot two or more graphs in the same window/software?



Momergil
17th June 2011, 13:29
Hello, everybody!

I have a problem concerning plotting two or more graphs in the same window.

What I want to do is a three-curve ECG real-time graphic plotter in one window, so, to understand what I mean, imagine the osciloscope example in the Qwt library with three osciloscopes functioning at the same time, one under the other.

I know that there is an example in the Qwt library which shows how to create more than one graph in the same window, but I couldn't understand its programming (more precisely, I couldn't figure it out where, in the programming, was the code to draw more than one graph).

So could somebody help?

I thanks very much!



Momergil

FelixB
17th June 2011, 14:01
a qwt plot is a qwidget, so you just have to create three qwt plots and insert them into a layout. done :)

Momergil
22nd June 2011, 20:16
a qwt plot is a qwidget, so you just have to create three qwt plots and insert them into a layout. done :)



Umm, thanks.

I'll see what I can do.

ChrisW67
23rd June 2011, 00:52
This is exactly what the Qwt plotmatrix demo (PlotMatrix class constructor) is doing: creating a series of QwtPlot objects and placing them in a QGridLayout. If you only want a vertical or horizontal set of three then use QVBoxLayout or QHBoxLayout. If you don't know how to use a layout then you should read Layout Management in the Qt reference documentation and look at the Basic Layout example.

Momergil
11th July 2011, 16:04
This is exactly what the Qwt plotmatrix demo (PlotMatrix class constructor) is doing: creating a series of QwtPlot objects and placing them in a QGridLayout. If you only want a vertical or horizontal set of three then use QVBoxLayout or QHBoxLayout. If you don't know how to use a layout then you should read Layout Management in the Qt reference documentation and look at the Basic Layout example.

Thank you! I will see what I can do.