You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

bdej

Beginner

  • "bdej" started this thread

Posts: 4

Location: Ottawa, Ontario

Occupation: programmer for nuclear medicine

  • Send private message

1

Thursday, March 9th 2006, 3:32pm

Making histogram using Qwt 5.0

Hi

I am trying to use Qwt 5.0 (snapshot released 2006-01-03) to make a histogram, but I cannot find any documentation on it. I can only find the class documentation on verson 4.2.0 or similar on the internet (http://qwt.sourceforge.net/annotated.html). My supervisor wants me to continue using this version because it is the latest one.

Would anyone be able to help me make a simple histogram with this version of Qwt or point me to the right places? I would greatly appreciate it.

Thank you,

Barbora

2

Friday, March 10th 2006, 12:16pm

RE: Making histogram using Qwt 5.0

1) Documentation is in the doc directory of every Qwt release/snapshot.
2) How to implement a histogram depends on what you mean by histogram.
If you ask on the Qwt mailing list with more details about your needs, I can show you how to do it.

HTH,
Uwe

bdej

Beginner

  • "bdej" started this thread

Posts: 4

Location: Ottawa, Ontario

Occupation: programmer for nuclear medicine

  • Send private message

3

Monday, March 13th 2006, 6:31pm

RE: Making histogram using Qwt 5.0

Uwe,

Thank you for your response. It is helpful to have these references, but I am unfortunately still stuck. I cannot seem to be able to display a curve. I always end up with an empty graph.

I am trying to draw a line-graph-like histogram for now, so not the vertical bar graph. I have the following code (mostly copied from the sample code in the doc folder):

QwtPlot *myPlot;
myPlot = new QwtPlot(QwtText(" "), Lbl_Histogram);
double x[6]= {0,1,2,3,4,5}, y1[6] = {0,1,2,3,4,5};

QwtPlotCurve *curve1 = new QwtPlotCurve(QwtText("Curve 1"));

// copy the data into the curves
curve1->setData(x, y1, 6);
curve1->attach(myPlot);

// finally, refresh the plot
myPlot->replot();

What I end up with is an empty graph in my label. The x and y axes range from 0 to 5. Do you happen to know why I am missing the actual data points?

Thanks so much for your time,

Barbora