Results 1 to 6 of 6

Thread: Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis)

  1. #1
    Join Date
    Oct 2016
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Lightbulb Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis)

    I am new to qwt and needs help on the following issue.
    I am using QWTPlot. It works fine normally when I plot data. I see proper scale division.

    However in certain conditions, when I zoom and unzoom the plot it leaves some space on both the axis before start painting.
    The start of the axis is shifted (its not margin, margin is set to 0) as seen in the attached image.

    Appreciate any pointers to resolve the issue. What property could I modify to get the proper plot behavior?plot_gap_issue.png

    Thanks
    SPanara

  2. #2
    Join Date
    Oct 2016
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis

    It seems canvas margin is getting screwed up.

    Attached is the image when I set canvas background to blue. I see the blue stripes on the left and bottom.
    I also see the first digit of one of the y-axis label (10000 ft) is distorted.

    I tried setting the canvas margin to 0 but did not help.

    canvas_bg_blue.jpg

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

    Default Re: Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis

    Qt Code:
    1. plot->plotLayout()->setAlignCanvasToScale( true );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  4. #4
    Join Date
    Oct 2016
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis

    I used setAlignCanvasToScale(true) but did not help

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

    Default Re: Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis

    Then post the code of a small and compilable demo.

    Uwe

  6. #6
    Join Date
    Oct 2016
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plotting does not start from the extreme left (x-axis) and extreme bottom (y-axis

    Thanks for the quick response!

    I am working on client application and its bit complex... will try to post the snippet of code.

    The detailed scenario is as follows,

    I have multiple plots open in QTabWidget. (ie. Plot A and Plot B).
    x-axis is displaying time series and y-axis height in meter

    I am on the tab for plot A. I zoom the plot and click on tab to view plot B (Plot A is in zoom condition only)

    Now I modify the y-axis scalling to show height in feet.
    When the unit is modified, I unzoom all the plots if zoomed (here plot A and B) and set the height range for feet.

    At this point, plot-B (which is visible now) works fine and adjust according to unit change.
    But, if I click on the Tab to view plot A (which was not visible when unit changed) does show the problem I explained earlier. It does change the height scalling as per the unit change. Only plotting is issue

    This happens all the time for the plot which is not displayed when unit change happens.

    Afterwards, if I zoom the plot (where I have issue in plotting) and unzoom ... It show the expected plot and issue disappears

    Are there any specific properties for which if it matters if plot is in foreground or background?

    Thanks
    SPanara

Similar Threads

  1. Huge image tearing / disappearing on extreme scaling
    By quimnuss in forum Qt Programming
    Replies: 1
    Last Post: 3rd May 2018, 11:02
  2. Replies: 0
    Last Post: 23rd January 2017, 12:55
  3. Replies: 2
    Last Post: 16th August 2011, 19:28
  4. Extreme Newbie!!
    By Kry in forum Newbie
    Replies: 5
    Last Post: 13th February 2010, 21: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.