PDA

View Full Version : How to set margin on one side of canvas plot (QwtPlot)



balvinder
9th February 2012, 15:59
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,

Spitfire
13th February 2012, 16:15
plot->setContentsMargins( 0, 100, 0, 0 );
// or
plot->plotLayout()->setCanvasMargin( 100, QwtPlot::xTop );
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.