Hello I have trouble with plot With LogScale.
My goals is to be able to switch between linearScale and LogScale for QwtPlot::xBottom direction
if (logarithmic)
{
m_plotWidget
->setAxisScaleEngine
(QwtPlot::xBottom,
new QwtLogScaleEngine
);
}
else
{
}
if (logarithmic)
{
m_plotWidget->setAxisScaleEngine(QwtPlot::xBottom, new QwtLogScaleEngine);
}
else
{
m_plotWidget->setAxisScaleEngine(QwtPlot::xBottom, new QwtLinearScaleEngine);
}
To copy to clipboard, switch view to plain text mode
But when trying to draw my curve starting by point (0,0)
in qwtToPolyLineFiltered()
points[0].rx() = round( xMap.transform( sample0.x() ) );
points[0].ry() = round( yMap.transform( sample0.y() ) );
Points is not correctly defined cause transform do not handle values out of bounds: (return d_p1 + ( log(0) - d_ts1 ) * d_cnv;
The starting point is completely wrong.
What i am doing wrong? and how could i do it works?
I am trying to change qwt source and in my case that works
{
if ( d_transform )
{
double boundValue = d_transform->bounded(s);
if ( boundValue != s )
{
s = d_ts1;
}
else
{
s = d_transform->transform( s );
}
}
return d_p1 + ( s - d_ts1 ) * d_cnv;
}
inline double QwtScaleMap::transform( double s ) const
{
if ( d_transform )
{
double boundValue = d_transform->bounded(s);
if ( boundValue != s )
{
s = d_ts1;
}
else
{
s = d_transform->transform( s );
}
}
return d_p1 + ( s - d_ts1 ) * d_cnv;
}
To copy to clipboard, switch view to plain text mode
Bookmarks