QCustomPlot Discussion and Comments

Aspect ratio of QCPColorMapReturn to overview

Is it possible to keep the aspect ratio of QCPColorMap when changing QCustomPlot size ?

That would be an awesome feature!

Any news on this? It would be great to keep aspect ratio of QCPColorMaps indeed!

This is already possible with the setScaleRatio method of the QCPAxis class.

Here is a basic example:

QCPAxis *x = qcp->axis(QCPAxis::atBottom);
QCPAxis *y = qcp->axis(QCPAxis::atLeft);
y->setScaleRatio(x, 1.0);

If you want to keep the aspect ratio when the size of the QCP widget is changed, then you have to override the resizeEvent method.