Results 1 to 3 of 3

Thread: Help with axes, again! :(

  1. #1
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Help with axes, again! :(

    My battles with Qwt Scales continues!

    I have a major problem in my code, and I'm not really sure where to look so I am looking for any kinds of help, even if I have to debug into the Qwt code itself. I'm not sure of an easy way to produce a sample program. Anyway, thanks for any advice!

    I have some code which prints a spectrogram aligned with a qwt axis scaled by time. I have this line of code which correctly produces ten ticks along the bottom of my plot: setAxisScale (whichAxis, start, stop, (stop - start) / 10.0); // for ten ticks!

    Here's the problem: when the start/stop is an even multiple of ten, I get a perfect plot (screenshot 1). However, when the code is a multiple of five, and not ten, I get the second screen shot. You can see the axis goes off the left and the right. Worse still, the plot is fine on the screen, but it is only when I print!

    Screen Shot 2012-10-11 at 3.09.05 PM.jpgScreen Shot 2012-10-11 at 3.09.22 PM.jpg

    Anyway, does anyone have any ideas?

    Thanks,
    Joey

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Help with axes, again! :(

    The ticks from the second screenshot looks like the result from: setAxisScale( 25, 45, 2 ) - o.k. so far.

    Misalignment of an axis should be a problem of an missing layout update - when you resize the plot I would expect that it goes away. The reason of a missing update is usually in the application code ( doing something tricky behind the back of the plot widget ), but without having a small demo I can't guess more.

    Uwe

  3. #3
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Help with axes, again! :(

    Thanks Uwe!

    In my case (in case it helps someone else!), I solved the problem by adding an updateAxes (); before the creation of a QwtPlotRenderer when I am printing. I'm guessing it wasn't getting called in my case since I was messing with the QwtPlot behind the scenes.

Similar Threads

  1. Replies: 2
    Last Post: 20th July 2012, 13:51
  2. Replies: 3
    Last Post: 2nd October 2011, 13:52
  3. Multiple axes with a relation
    By pkj in forum Qwt
    Replies: 1
    Last Post: 21st February 2011, 06:46
  4. Zoom and pan with two y-axes
    By mjfj in forum Qwt
    Replies: 1
    Last Post: 19th October 2010, 10:39
  5. Plot Axes
    By mcarter in forum Qwt
    Replies: 0
    Last Post: 4th December 2009, 23:47

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.