Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to make point's text lable adjust with scale of x-axis and y-axis in QCustomPlot?
hitbuyi last edited by hitbuyi
x = 10;
y = 50;
x_offset = 0.7;
y_offset = 1.0;
QCPItemText *textLabel = new QCPItemText(ui->widget);
textLabel->position->setCoords(x- x_offset, y + y_offset); // place position at center/top of axis rect
textLabel->setFont(QFont(font().family(), 8)); // make font a bit larger
The problem is , if x-axis range is (-20,20), y-axis range is (-50,100), the text lable is near the point(x,y) properly. when x-axis range is set to (-200,200), y-axis range is set to (-500,500), the lable is merge with point(x,y) because of large scale, what I want is lable's postion is near the point from the eye of view
how to solve this problem? for this kind of problem,MATLAB solved it perfectly, point and its lable are
displayed rightly under different scale of x-axis and y-axis
If you don't get any answers here, try the QCustomPlot forum.
QCustomPlot is not an official Qt module so you have to be lucky that someone knows here.