Results 1 to 5 of 5

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How do I plot two or more graphs in the same window/software?

    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

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I plot two or more graphs in the same window/software?

    a qwt plot is a qwidget, so you just have to create three qwt plots and insert them into a layout. done

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How do I plot two or more graphs in the same window/software?

    Quote Originally Posted by FelixB View Post
    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.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How do I plot two or more graphs in the same window/software?

    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.

  5. #5
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How do I plot two or more graphs in the same window/software?

    Quote Originally Posted by ChrisW67 View Post
    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.

Similar Threads

  1. Replies: 5
    Last Post: 17th June 2011, 12:12
  2. Displaying plot in main QT window
    By Gavin Harper in forum Qwt
    Replies: 1
    Last Post: 23rd August 2010, 13:59
  3. Graphs in Qt
    By qtlinuxnewbie in forum Newbie
    Replies: 4
    Last Post: 20th February 2010, 12:01
  4. Replies: 1
    Last Post: 27th August 2009, 23:06
  5. Double Buffering for plot graphs
    By Tavit in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 13:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.