View Full Version : Showing text to label curves on QwtPlot

5th September 2008, 02:03
Hi everyone, I am pretty new to using Qt so I apologize if there is an obvious solution I am missing. I am working on an application that draws vacuum tube plate curves. Everything is working great but I am stuck on how to label the curves.

Each curve is a plot of points on the plate voltage (xAxis) vs plate current (yAxis) for a fixed grid bias voltage. however I cannot figure out how to label the curves so the user knows what the bias voltage of each curve is. A legend doesn't work because I want all the curves to be the same color and there could be up to 200 curves on a plot which makes for a huge legend.

What I need to be able to do is label each curve on the plot with text that contains its bias voltage. I can't figure out how to make that happen. The axis's are both scalable by the users and the bias voltage steps are adjustable also (this simply hides the unused curves).

A picture is always easier to understand so here is a picture of the way the program looks now:


and here is the same image modified to show how I would like it to look:


any ideas on how to implement this. I have poured through all the documentation of the Qwt classes and can't seem to figure out how to do this. I am new to Qt and don't have alot of experience programming in C++ so maybe I am just overlooking something obvious. I would just like to know how to get this working. Thanks in advance for any advice.

11th September 2008, 09:07
You could try to use a QwtPlotMarker.