PDA

View Full Version : Plotting a Standart Normal Distribution curve



Andre.Oliveira
9th February 2015, 18:05
Hello,

I've been using QwtPlotHistogram in my application for a while, and recently a new feature was requested. The idea is to always (or, at the very least, provide an option to) plot a Normal Distribution curve along with the histograms.

Something like this: 10949

I was wondering if qwt already provides any function related to this, if so, I'd rather use it. If not, does anyone have any hints as to how implement this? For now, I'm using std::normal_distribution to generate the values based on a previously calculated mean and standart deviation, but I'm wondering if there is a faster way to implement this based solely on QwtPlot coordinates instead of calculating so many values.

Any help or hints are greatly appreciated.

Uwe
11th February 2015, 07:45
In case of QwtPlotHistogram you have a vector of (x1, x2, y ) samples that of course could be mapped to vector of ( x1 + 0.5 * ( x2 - x1 ), y ) points and being plotted as a curve.
But this sounds so trivial, that I'm wondering if this is really all you are looking for ?

Uwe