1 Attachment(s)
It is a possible to disable QwtPlot autoscaling of contents?
I want to disable contents autoscaling of QwtPlot, but i don't know how do this.
I wrote a simple hack for this:
Code:
...
{
if (o == canvas())
{
if (e
->type
() == QEvent::Resize) {
setAxisScale
(QwtPlot::xBottom,
0, re
->size
().
width());
setAxisScale
(QwtPlot::yLeft,
0, re
->size
().
height());
replot();
}
}
}
But it looks ugly (
This screenshots points to what i mean:
Attachment 7948
What can i do?
Re: It is a possible to disable QwtPlot autoscaling of contents?
Your code assigns widget coordinates as plot coordinates ...
The easiest way to disable autoscaling ( what is not what you mean by autoscaling ! ) is to assign a scale. But you are looking for QwtPlotRescaler. Check the navigation example - the second combo box should do what you need.
Note that it is not always possible to have a fixed aspect ratio for the plot canvas. The problem here is a ping-pong effect between the adjustments of the scales ( according to the size of the canvas ) and the space that is needed for the resulting tick labels, that might modify the size that is left for the canvas.
Uwe