Hi, I need to plot a histogram but I do not know how. Documentation was not helpful enough. Here is my code
{
plt->setTitle(dataName);
plt
->setAxisTitle
(QwtPlot::xBottom,
"Label");
plt
->setAxisTitle
(QwtPlot::yLeft,
"Values");
QwtPlotHistogram *hist = new QwtPlotHistogram("blabla");
QVector<QwtIntervalSample> data;
data.append(QwtIntervalSample(1,0,4));
data.append(QwtIntervalSample(3,0,7));
hist->setSamples(data);
hist->attach(plt);
}
void Plot(QwtPlot *plt)
{
plt->setTitle(dataName);
plt->setAxisTitle(QwtPlot::xBottom, "Label");
plt->setAxisTitle(QwtPlot::yLeft, "Values");
QwtPlotHistogram *hist = new QwtPlotHistogram("blabla");
QVector<QwtIntervalSample> data;
data.append(QwtIntervalSample(1,0,4));
data.append(QwtIntervalSample(3,0,7));
hist->setSamples(data);
hist->attach(plt);
}
To copy to clipboard, switch view to plain text mode
Basically I want two columns, one labelled "1" ranging from 0 to 4 and one labelled "3" ranging from 0 to 7. Something like this image
Any help is appreciated
Bookmarks