Results 1 to 7 of 7

Thread: QwtPlotGrid, precise grid and backgroundimage

  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 QwtPlotGrid, precise grid and backgroundimage

    Hello!

    In my software where I need to plot a QwtPlot showing medical, ECG-like curves, I need a grid that simulate a graph paper with precision - because I will add a print possibility that when the printing will be done, the result in the paper will have to be in precise scale so it can be measured with ruler or caliper rule by a doctor.

    Essentially what I'm doing is to copy the following graph (that was done using OpenGL) to Qwt code:

    Curvas - 2.jpg

    Question: is that possible?


    Thanks,

    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: QwtPlotGrid, precise grid and backgroundimage

    Hi,

    a QwtPlotGrid paints the lines at the ticks of the corresponding axis. Give it a try, it should be precise enough.

    Felix

  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: QwtPlotGrid, precise grid and backgroundimage

    Quote Originally Posted by FelixB View Post
    Hi,

    a QwtPlotGrid paints the lines at the ticks of the corresponding axis. Give it a try, it should be precise enough.

    Felix
    Well, i'm already using QwtPlotGrid, but it's being quite hard to find exactly the "coordinates" to plot the graph paper. So if there is a better solution, I'ld be glad to test it.


    Momergil

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

    Default Re: QwtPlotGrid, precise grid and backgroundimage

    could you explan that a bit more? I don't understand what you mean "find exactly the coordinates to plot the graph paper".

    Felix

  5. #5
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotGrid, precise grid and backgroundimage

    I'm guessing he wants the grid on the plot to align exacly with the grid on the paper he later prints on.

  6. #6
    Join Date
    Mar 2012
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QwtPlotGrid, precise grid and backgroundimage

    hellow every body ,i need help from you to read file .ecg and plot it by using qwt ,
    i need this in the nearest time because this help me in my project


    Added after 43 minutes:


    i need help ,how i plot data coming from file.ecg ?
    Last edited by engy oun; 27th March 2012 at 21:09.

  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QwtPlotGrid, precise grid and backgroundimage

    What is this, you and Ahmed Ali all have the same homework assignment?

    First, NO ONE HERE knows what an "ecg" file is, as has been explained over and over to Ahmed. If it is a binary file, and you do not know the format, no one else here will either. "ecg" is simply a file extension, it could contain almost any format imaginable.

    Once you have read the file into one or more arrays of (x, y) pairs, then it is extremely simple to plot this using Qwt. Simply look at the Qwt examples and substitute your x,y data for the x,y data in the example.

    And don't hijack someone's thread to ask a new question. Start a new thread.


    Added after 5 minutes:


    Quote Originally Posted by Spitfire View Post
    I'm guessing he wants the grid on the plot to align exacly with the grid on the paper he later prints on.
    That would be nearly impossible, I think. Even if he did get it right for one printer, another printer might behave completely differently, or even the same printer with a different output setting (like fit to page vs. no scaling). And if I remember correctly, Qwt will layout the width of the y-axis depending on the precision of the numbers on the ticks, so if the ticks change, the layout changes, too.
    Last edited by d_stranz; 28th March 2012 at 00:11.

Similar Threads

  1. painting in QwtPlotGrid
    By ready in forum Qwt
    Replies: 2
    Last Post: 18th July 2011, 06:26
  2. Better Grid
    By Buby in forum Newbie
    Replies: 2
    Last Post: 7th September 2010, 09:18
  3. QGraphicsItem, QLineF Precise Selection
    By prashant in forum Qt Programming
    Replies: 1
    Last Post: 29th October 2009, 10:01
  4. Coding Precise Layouts
    By JimDaniel in forum Qt Programming
    Replies: 6
    Last Post: 15th September 2007, 21:30
  5. Grid layout
    By nupul in forum Qt Programming
    Replies: 7
    Last Post: 21st April 2006, 21:15

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.