Results 1 to 2 of 2

Thread: graphing logarithmic data

  1. #1
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default graphing logarithmic data

    I have a custom widget that uses data from Well Logs to draw skwiggle lines with a paintEvent() like shown in the attached image.

    In this image there are 3 separate graphs: 1) the one on the left with red, black, and blue lines, 2)the one on the right with just the blue and red lines, and 3) the one in the middle with 3 different green/light blue lines. The data for the left and right graph are linear (#1 and #3); the data for the middle graph are logarithmic. This is what I need help with.

    The width of my rectangle where I'm drawing the skwiggle lines is 100 pixels. If I want to draw a skiggle line for a Well Log attribute that is LINEAR with a data range of 0 through 200, I calculate the X location like so:

    xLocationInGraph = int( (attributeValue / 200) * 100 );

    So if the attribute is low--10, for example--that part of the skwiggle line will be close to the left side of the rectangle: 10 / 200 * 100 = 5. If the attribute is at the higher end of the data range--170, for example--that part of the skwiggle line will be close to the right side of the rectangle: 170 / 200 * 100 = 85. This is easy/straight-forward.

    But I don't know how to do this for logarithmic data. In the attached image, the data range is .2 to 2000 (the middle, logarithmic graph). This is similar to my data (the ranges will be either .2-20, or .2-200, or .2-2000). My questions are:

    1. In the attached image, in the central graph (the logarithmic graph), is the far left line .2? And the next weighted line to the right 2? And the next 20? And the next 200? And the next 2000? If so, what is the value of the space between this last weighted line--2000--and the right side of the graph? There's a relatively wide spacing here... which looks like it should be all the way over to the left side of the graph. I've seen other graphs similar to this; why?

    2. How do I convert from the logarithmic data values to xLocationInGraph values? For example, the Well Log data values might look like this:

    .22
    .49
    1.78
    1300.27
    26.83
    .88

    ....which I need to convert to x values between 0 and 100... so they'll plot on my graph widget. How to do this?

    Thank you!
    Attached Images Attached Images

  2. #2
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: graphing logarithmic data

    NEVERMIND!! i figured it out.

Similar Threads

  1. Qt and Graphing tools
    By deepakn in forum General Programming
    Replies: 2
    Last Post: 11th August 2009, 18:41
  2. Scaling and zooming with logarithmic scales
    By Benoît Hubert in forum Qwt
    Replies: 1
    Last Post: 11th September 2008, 10:17
  3. logarithmic scale
    By Times in forum Qwt
    Replies: 2
    Last Post: 1st July 2008, 16:41
  4. Replies: 2
    Last Post: 14th March 2008, 13:38
  5. QT Graphing Toolkits
    By dlautz in forum Qt Programming
    Replies: 3
    Last Post: 27th April 2006, 20: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.