View Full Version : understanding QwtPlot::transform()

22nd May 2008, 07:38
Hi! I'm trying to draw Point and Figure chart (see attachment). As you can see on this chart the size of the symbols is too small for this scale. I want to compute the size of the symbols depending on the number of columns on the chart. I'm trying to use QwtPlot transform() function, but i dont understand how it works. For example it returns the same result in both of this cases:

current_plot->transform(QwtPlot::xBottom, 20.0);
current_plot->transform(QwtPlot::xBottom, 21.0);

I'm new to qwt, can anyone help???

25th May 2008, 07:43
QwtPlot::transform() is to be used to transform the (x,y) coordinates in the plot coordinates system to the global widget coordinates and the output is in units of screen points which are integers. Hence, both your code will give the same result because they are far to close. Try these:

current_plot->transform(QwtPlot::xBottom, 20.0);
current_plot->transform(QwtPlot::xBottom, 11.0);

and you will see the difference in output.

One way could be instead of using transform, you can directly set the size of the QwtSymbol depending on you column number, which is in plot-coordinates.