Results 1 to 2 of 2

Thread: Plotting graph of 1/x

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Plotting graph of 1/x

    Hi,
    I'm writing a little application to plot graphs using qt 4.4 and qwt.
    The script is parsed using QtScript, and the program calculates for each x value an y value using the script. (with dx between the points). The points are then plotted using qwt.
    This works good, but when you try to plot the graph for 1/x (or other functiosn returning NaN), there is a problem. Qwt draws the NaN value and you get the following graph instead of two "asymptotes":

    Is there a way to solve this? (I could create two curves, one for -10 < x 0 and one for 0 < x < 10, but I would get problems with functions like 1 / (x -2)

    Edit: I just did some others test and you get similiar problems with other graps with NaN values: for instance

    Math.sqrt(plotx); (x ^ 0.5 )
    and
    Math.log(plotx); (ln(x))
    Attached Images Attached Images
    Last edited by Persoontje; 19th February 2009 at 15:19.

Similar Threads

  1. Graph plotting
    By steg90 in forum Qt Programming
    Replies: 13
    Last Post: 6th April 2011, 10:30
  2. Plotting from Left to Right ??
    By dheeraj in forum Qwt
    Replies: 3
    Last Post: 3rd June 2008, 07:09
  3. Plotting a graph with QWT
    By steg90 in forum Qwt
    Replies: 1
    Last Post: 6th June 2007, 17:04
  4. Threading and plotting graph in same program.
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 9th May 2007, 20:42
  5. regarding graph plotting in qt
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 11
    Last Post: 30th April 2007, 08:51

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.