I have a QwtPlot where I want to place a label such that it is at a given coordinate on the y-axis but is always centered on the x-axis, even when the axis scale is updated. I'm really lame at this stuff, but I suspect that this would involve handling a "redraw()" method so that the x-position is recalculated. But I'm not sure.
If I want to draw the label at a gtiven coordinate in both x and y, I do the following:
text.setColor(text_color);
label_mark->setValue(x, y);
label_mark->setLabel(text);
label_mark->attach(thisPlot);
text.setFont(QFont("Helvetica",24, QFont::Bold));
text.setColor(text_color);
QwtPlotMarker *label_mark;
label_mark = new QwtPlotMarker();
label_mark->setValue(x, y);
label_mark->setLabel(text);
label_mark->attach(thisPlot);
To copy to clipboard, switch view to plain text mode
Simple. Is there something equally simple to have x instead be the center of the plot?
Bookmarks