Hello,

I'd like to plot a spectrogram with fixed aspect ratio (1:1) and have zooming/unzooming feature. I added the following code to the spectrogram example:
Qt Code:
  1. QwtPlotRescaler *d_rescaler = new QwtPlotRescaler(canvas());
  2. d_rescaler->setRescalePolicy(QwtPlotRescaler::Fitting);
  3. d_rescaler->setReferenceAxis(QwtPlot::xBottom);
  4. d_rescaler->setAspectRatio(QwtPlot::yLeft, 1.0);
  5. d_rescaler->setAspectRatio(QwtPlot::yRight, 0.0);
  6. d_rescaler->setAspectRatio(QwtPlot::xTop, 0.0);
  7. d_rescaler->setExpandingDirection(QwtPlotRescaler::ExpandBoth);
  8. d_rescaler->setIntervalHint(Qt::XAxis, d_spectrogram->data()->interval( Qt::XAxis ));
  9. d_rescaler->setIntervalHint(Qt::YAxis, d_spectrogram->data()->interval( Qt::YAxis ));
To copy to clipboard, switch view to plain text mode 

When I zoom in selecting a rectangular region the original aspect ratio (1:1)
is not preserved. Also when I resize the window the zoom is not preserved, it gets
unzoomed to original size.

What is the proper way of having a zoom and fixed aspect ratio using spectrogram?

Thanks,
Dusan