Results 1 to 5 of 5

Thread: How to draw plot with gap

  1. #1
    Join Date
    Mar 2016
    Posts
    14
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default How to draw plot with gap

    Hi everyone!
    How to draw plot with gap like tg(x), 1/(1-x) or parametric plots, for example:
    Qt Code:
    1. x > 0, f(x) = 1;
    2. x < -3, f(x) = sin(x);
    3. x = [-3, 0], f(x) = -10;
    To copy to clipboard, switch view to plain text mode 
    ?
    Need to draw one curve for one function.

  2. #2
    Join Date
    Mar 2011
    Posts
    25
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to draw plot with gap

    You should draw every range of the data with separate curve.

  3. #3
    Join Date
    Mar 2016
    Posts
    14
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to draw plot with gap

    I need to monitor functions by signal void QwtPolarPlot::itemAttached (QwtPolarItem *plotItem, bool on), to know, which functions are added.
    The approach with using separate curves for one function is not suitable for me.

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,277
    Thanked 871 Times in 819 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to draw plot with gap

    Then overload QwtPolarCurve::drawLines() and split it into 2 QPainter:drawPolyline calls.

    Uwe

  5. #5
    Join Date
    Mar 2016
    Posts
    14
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to draw plot with gap

    Thanks, but QwtPolarCurve::drawLines() not virtual.
    I did something like this:
    Qt Code:
    1. class A : public QwtPolarCurve
    2. {
    3. private:
    4. QwtPolarCurve *m_firstCurve;
    5. QwtPolarCurve *m_secondCurve;
    6. };
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Can I use Qwt library to draw 3D plot?
    By theofthe in forum Qwt
    Replies: 1
    Last Post: 6th April 2015, 09:11
  2. How to draw a line anywhere on qwtpolar plot
    By vishaal_sss in forum Qwt
    Replies: 0
    Last Post: 23rd December 2014, 07:23
  3. Draw a single point into a qwt plot
    By Qwt_beginner in forum Qwt
    Replies: 2
    Last Post: 12th December 2011, 09:32
  4. Is it possible to draw axis in Plot?
    By beni46 in forum Qwt
    Replies: 2
    Last Post: 26th January 2010, 12:54
  5. Help: How to draw markers on plot?
    By jwieland in forum Qwt
    Replies: 5
    Last Post: 24th November 2009, 11:22

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.