Results 1 to 2 of 2

Thread: How to set margin on one side of canvas plot (QwtPlot)

  1. #1
    Join Date
    Feb 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default How to set margin on one side of canvas plot (QwtPlot)

    Is there a way in Qwt to set margin only on one side of the canvas. Function setMargin() in QwtPlotLayout sets margin on all sides, but I am looking to set such margin only on the top side of the plot.
    I searched but could not find anyone having the similar issue. I have attached one image for more clarification on the question.

    Thanks,
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to set margin on one side of canvas plot (QwtPlot)

    Qt Code:
    1. plot->setContentsMargins( 0, 100, 0, 0 );
    2. // or
    3. plot->plotLayout()->setCanvasMargin( 100, QwtPlot::xTop );
    To copy to clipboard, switch view to plain text mode 
    But if you hope that this will provide space for your title then you'll be disappointed (unless you draw it yourself instead of using plot->setTitle()).

    Edit:
    ps. Next time post questions related to Qwt in the Qwt sub-forum.

Similar Threads

  1. QwtPlot Canvas Size Hint?
    By umituzun84 in forum Qwt
    Replies: 8
    Last Post: 22nd September 2011, 16:21
  2. QwtPlot offset between Canvas and Scale
    By revellix in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2011, 13:31
  3. Blank space at right side of plot
    By liversedge in forum Qwt
    Replies: 2
    Last Post: 14th August 2010, 13:02
  4. Replies: 0
    Last Post: 4th May 2010, 09:45
  5. Replies: 1
    Last Post: 29th November 2008, 12:37

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.