To set a logarithmic scale for 1-100
Qt Code:
plot->replot();To copy to clipboard, switch view to plain text mode
Uwe
To set a logarithmic scale for 1-100
Qt Code:
plot->replot();To copy to clipboard, switch view to plain text mode
Uwe
dimmes (20th November 2014)
Hi Uwe,
i have made it and i managed to draw the scale but my problem is that i want to plot the values as lines and not as dots, i was thinking to connect the dots with qwt marker but the connection is only horizontial or vertically! is there any solution to plot those values,in log scale, with line connection?
thanks.
The line style of a curve is completely unrelated to the fact, that you have a logarithmic scale.
Have a look at the bode example showing a logarithmic scale with curves in QwtPlotCurve::Lines style.
Uwe
Hi there, hi Uwe,
i think i have the same problem. I use QwtPlotMultiBarChart and QwtLogScaleEngine. But the bars are drawn from the top down to the correct values.
I stripped it to this:
Inside my Linix and on Windows the problem appears, looking like this:m_pPlot = new QwtPlot(this);
m_pPlot->setCanvasBackground(Qt::white);
m_pPlot->setAxisScaleEngine(QwtPlot::yLeft, new QwtLogScaleEngine());
m_pPlot->setAxisScale(QwtPlot::yLeft, 1, 500);
m_pPlot->resize(460,460);
m_pPlot->show();
QVector< QVector<double> >* allValues = new QVector< QVector<double> >();
for(int s=1; s<=3; s++)
{
QVector<double>* sampleValues = new QVector<double>;
sampleValues->append(10*s);
sampleValues->append(100*s);
allValues->append(*sampleValues);
}
QwtPlotMultiBarChart* multiBars = new QwtPlotMultiBarChart();
multiBars->setSamples(*allValues);
multiBars->attach(m_pPlot);
m_pPlot->replot();
Bildschirmfoto1.png
On an embedded linux device from Garz & Fricke it's ok, it looks how it should look.
The Qwt files are compiled into the application file.
I tried qwt 6.1.0 and 6.1.3.
The bars are painted from the baseline of the item to the value. As the default setting for the baseline is 0 you have something invalid for a logarithmic scale.
Guess adding the following line is what you are looking for:
UweQt Code:
multiBars->setBaseline( 1.0 );To copy to clipboard, switch view to plain text mode
Thats exactly what i need. Thank you.
Actually i am often confused with the assigned names for member, functions, etc. in Qwt, which i can't classify.
Quoting from http://qwt.sourceforge.net/class_qwt...f2880a4bf683ad: "The baseline is the origin for the chart. Each bar is painted from the baseline in the direction of the sample value."
What would you consider to be better than "baseline" - in this particular context ?
Uwe
improvement suggestion:
The default value for the baseline is 0 for linear scales.
The default value for the baseline is 1 for logarithmic scales.
That could be an improvement for Qwt.
Bookmarks