Remove space between axis and plot
Hey,
I'm doing my first steps with qwt for a new project, but I have run in some little problems. I try to remove the space between the x-axis and the the plot so that the x-axis is located on the baseline. But I don't get it work. This is my current approach:
Code:
ui->qwt_Curve->plotLayout()->setAlignCanvasToScales(true);
ui
->qwt_Curve
->axisWidget
(QwtPlot::xBottom)->setMargin
(0);
ui
->qwt_Curve
->axisWidget
(QwtPlot::xBottom)->setSpacing
(0);
ui
->qwt_Curve
->axisWidget
(QwtPlot::xBottom)->scaleDraw
()->setMinimumExtent
(0);
ui
->qwt_Curve
->plotLayout
()->setCanvasMargin
(0,
QwtPlot::xBottom);
Do you have any hints for me?
Thanks and best regards
Ozzy
Re: Remove space between axis and plot
Code:
dynamic_cast<QFrame
*>
(plot
->canvas
())->setFrameStyle
( QFrame::NoFrame );
plot
->axisWidget
(QwtPlot::xBottom)->setMargin
(0);
Uwe
Re: Remove space between axis and plot
Hi,
thanks for your reply. But there is still a very small space between the zero line and the axis-line. Is there any further trick to remove this and set the baseline to the zero line?
Re: Remove space between axis and plot
Quote:
Originally Posted by
Ozzy
thanks for your reply. But there is still a very small space between the zero line and the axis-line.
What zero line ?
Uwe
Re: Remove space between axis and plot
Hi,
when I plot a chart with only zero points (e.g. System load on a cpu with no load..) there is still a small space between the zero line and the axis.
Re: Remove space between axis and plot
Again: what do you mean by "zero line" - the position of some value 0 of a y axis ?
Uwe
Re: Remove space between axis and plot
Right. The position of zero values on the x-axis (bottom).
Re: Remove space between axis and plot
Better upload a screenshot of what you want to do.
Uwe
1 Attachment(s)
Re: Remove space between axis and plot
Hi,
Attachment 9930
Here you can see that the points with 0.0 on the x axis are not on but above the axis. I hope it is getting clearer now.
Re: Remove space between axis and plot
Please add gridlines for the y axis ( maybe in red ) and set the canvas background to cyan and upload another screenshot.
Uwe
1 Attachment(s)
Re: Remove space between axis and plot
Hi,
this is the new plot:
Attachment 9934
Thanks and best regards
Ozzy
Re: Remove space between axis and plot
Where you can see, that the zero line ( 0 at y left ) is exactly the first pixel in the canvas.
You could disable the backbone of the scales ( see QwtScaleDraw ) and draw a line at y=0 inside the canvas - if this is what you want to do.
Uwe
Re: Remove space between axis and plot
Hi,
thanks for your reply! This works for me!!!
Thanks and best regards
Ozzy