Results 1 to 6 of 6

Thread: Qwt: Axis Border Dist?

  1. #1
    Join Date
    Jan 2014
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qwt: Axis Border Dist?

    I have two plots which has created by using qwt. But I couldn't sync their axis(xBottom) with each other.

    Ekran Alıntısı.jpg


    They both have (30,30) BorderDist

    Qt Code:
    1. plot1->axisWidget(QwtPlot::xBottom)->setMinBorderDist(30,30) //distance between axis and border
    2. plot2->axisWidget(QwtPlot::xBottom)->setMinBorderDist(30,30) //distance between axis and border
    To copy to clipboard, switch view to plain text mode 

    but only upper plot apply this function and there is a difference between axises.

    How can I solve this?

    Regards.

  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: Qwt: Axis Border Dist?

    What about this:

    Qt Code:
    1. const int margin = 30;
    2. plot1->plotLayout()->setCanvasMargin( margin, QwtPlot::yLeft );
    3. plot1->plotLayout()->setCanvasMargin( margin, QwtPlot::yRight );
    4. plot2->plotLayout()->setCanvasMargin( margin, QwtPlot::yLeft );
    5. plot2->plotLayout()->setCanvasMargin( margin, QwtPlot::yRight );
    To copy to clipboard, switch view to plain text mode 
    You probably need Qwt 6.1.1 - AFAIR 6.1.0 had a bug when setting canvas margins in combination with hidden axes.

    Uwe

  3. #3
    Join Date
    Jan 2014
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt: Axis Border Dist?

    Hey Uwe,

    I tried you advise but when i does:
    Qt Code:
    1. enableAxis(QwtPlot::xBottom,false)
    To copy to clipboard, switch view to plain text mode 
    for plot2, it doesn't care margin value. By the way I tried also in version6.1.1 it has same result.

  4. #4
    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: Qwt: Axis Border Dist?

    Adding the following lines to the simpleplot example in the 6.1 branch shows the expected result:

    Qt Code:
    1. plot.enableAxis( QwtPlot::xBottom, false );
    2. plot.plotLayout()->setCanvasMargin( 30, QwtPlot::yLeft );
    3. plot.plotLayout()->setCanvasMargin( 30, QwtPlot::yRight );
    To copy to clipboard, switch view to plain text mode 
    Guess something went wrong on your side with installing/using Qwt 6.1.1 ?

    Uwe

  5. #5
    Join Date
    Jan 2014
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt: Axis Border Dist?

    I think "axis numbers" cause this problem. if I give border width enough, two plots axises are great.

    Thanks again Uwe.

  6. #6
    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: Qwt: Axis Border Dist?

    Quote Originally Posted by alperyazir66 View Post
    I think "axis numbers" cause this problem.
    Yes of course - there needs to be space for the outer halfs of the outmost tick labels.

    Both - the border distances of the scale widgets and the canvas margins - have the effect to create extra spaces, but the canvas margin works regardless if a scale is hidden or not.

    Uwe

Similar Threads

  1. Replies: 10
    Last Post: 9th September 2013, 15:29
  2. Replies: 2
    Last Post: 21st March 2012, 14:30
  3. Replies: 5
    Last Post: 26th June 2011, 11:43
  4. QMake dist-like target?
    By akos.maroy in forum Qt Tools
    Replies: 5
    Last Post: 31st January 2010, 15:49
  5. Minimal Linux dist to run Qt-app from
    By AnAx in forum Installation and Deployment
    Replies: 8
    Last Post: 6th May 2009, 16:00

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.