I'm using a qwtpolarplot widget from 180 to -180, and I need that the widgets on the axes:
360 -----------> 180
270 -----------> -90
180 -----------> -180
90 -----------> 90
how can I change this label?
ImmaginePolarPlot.jpg
I'm using a qwtpolarplot widget from 180 to -180, and I need that the widgets on the axes:
360 -----------> 180
270 -----------> -90
180 -----------> -180
90 -----------> 90
how can I change this label?
ImmaginePolarPlot.jpg
Thanks for your help...
Another solution is the following:
class AzimuthScaleDraw: public QwtRoundScaleDraw
{
public:
virtual QwtText label( double value ) const
{
QwtText text;
double valueReturn;
if ((value>0) && (value < 180))
{
valueReturn = value;
}
else if ((value == 0) || (value ==360))
{
valueReturn = 180;
}
else if ((value == 180))
{
valueReturn = -180;
}
else
{
valueReturn = value -360;
}
return QwtRoundScaleDraw::label( valueReturn );
}
};
and use:
QwtPolarGrid *grid;
grid->setAzimuthScaleDraw( new AzimuthScaleDraw() );
what do you think about it ????
Well your code changes the labels, but not the transformation - so it depends on your data. If a point at -180 has to be displayed at 180 your code does it, if the coordinates of your data is intended to match the scales my proposal is better.
Uwe
Thanks...yes my code change only labels !!!! For transformer poin plot I used the example code qwt spectrogram !!!
Bookmarks