setting axis of qwtplot
QwtPlotRescalerQwtPlotRescalertakes care of fixed aspect ratios for plot scales.QwtPlotRescalerauto adjusts the axes of aQwtPlotaccording to fixed aspect ratios.usage:d_rescaler->setEnabled(true);d
·
1.fixed aspect ratios for plot scales
It's used for plotting geometry
QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
QwtPlotRescaler auto adjusts the axes of a QwtPlot according to fixed aspect ratios.
ExpandingDirection
ExpandUp | The upper limit of the scale is adjusted. |
ExpandDown | The lower limit of the scale is adjusted. |
ExpandBoth | Both limits of the scale are adjusted. |
RescalePolicy
Usage:
d_rescaler->setEnabled(true);
d_rescaler->setReferenceAxis(QwtPlot::xBottom);
d_rescaler->setAspectRatio(QwtPlot::yLeft, 1.0);
d_rescaler->setAspectRatio(QwtPlot::yRight, 0.0);
d_rescaler->setAspectRatio(QwtPlot::xTop, 0.0);
// used fitting method but changed Expanding option to
// zoom and pan the plot for fixed aspect ratio plots
d_rescaler->setRescalePolicy(QwtPlotRescaler::Fitting);
QwtPlotRescaler::ExpandingDirection direction = QwtPlotRescaler::ExpandBoth;
for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
d_rescaler->setExpandingDirection(direction);
d_rescaler->setIntervalHint(QwtPlot::xBottom, QwtDoubleInterval(x[0] - dx*margin, x[1] + dx*margin));
d_rescaler->setIntervalHint(QwtPlot::yLeft, QwtDoubleInterval(x[2] - dy*margin, x[3] + dy*margin));
d_rescaler->rescale();
2.variable aspect ratios for plot scales
It's used for single curves.
Usage:
if(d_rescaler)
d_rescaler->setEnabled(false);
setNiceAxisScale(QwtPlot::xBottom, x[0] - dx*margin, x[1] + dx*margin);
setNiceAxisScale(QwtPlot::yLeft, x[2] - dy*margin, x[3] + dy*margin);
Revision: 12207
Date: Saturday, January 9, 2021 12:10:56 PM
Message:
replace plt_xxx series with draw_xxx series in 3D module
更多推荐
已为社区贡献1条内容
所有评论(0)