PDA

View Full Version : Showing a label in a QwtPlot



Momergil
20th November 2013, 18:47
Hello!

I want to show some text label inside a QwtPlot but I'm not sure how to do it. I found three classes that may fit (QwtPlotMarker, QwtPotTextLabel and QwtTextLabel), but none of them worked till now. The last two I simply can't find a way how to put it in the desired coordinates, and I can't find a way to show the text with QwtPlotMarker without showing a line (which I don't want to do; I just want the text).


I'm glad for any help,


Momergil

Uwe
21st November 2013, 06:37
QwtPlotMarker is for showing a text label at a specific plot coordinate ( the default setting is without any lines, so don't tell me that you can't find a way without it ), QwtPotTextLabel is a text at a widget ( = canvas ) coordinate ( f.e. in the top/left corner ).

Uwe

Momergil
22nd November 2013, 02:12
Thanks, Uwe.

Now that was interesting: the problem was a matter of color; I was trying to paint a black label in a graph with a black background, without noticing that the place where I was telling the color was wrong - should have been the QwtText's color, not the line's one.