[ROOT] Plot with Error Bars

From: Sean Walston (walston@ampere.uoregon.edu)
Date: Fri Jun 09 2000 - 05:51:48 MEST


Here is what I have:

1) A 1-D array of x values
2) A 1-D array of errors which correspond to the x values
3) A 1-D array of y values
4) A 1-D array of errors which correspond to the y values

Here is what I want to do:

1) Make a plot with error bars on the data points
2) Save this plot with a plot title, axis titles, and the whole enchilada
to an output file which also is used to store other plots (TH1Fs) and an
TNtuple.

I see how this can be done in principle based on example 23 under Root
Tutorials, "Example of several graphs with errors in the same pad" and
example 21, "Example of a Simple Graph with axis titles", but this method
results in a TCanvas, and I have not yet figured out how to write this
resulting canvas, lock, stock, and axis titles, to the output file in a
manner analogous to writing a TH1F or an TNtuple to the output file: i.e.
canvas->Write() has not worked for me. In short, I can essentially produce
the graph which I want, but it disappears as soon as the destructor in my
program is called and I loose the information because I haven't managed to
save the canvas to the output file. Any suggestions?


I have looked at the documentation on TProfile, and am mystified by

virtual Int_t Fill(Axis_t, Stat_t)

I think I understand Axis_t just fine, but so far I have found very little
on the nature of Stat_t. Could I simply feed this Stat_t the elements of
my error array?

Thank you for your help -- Sean

__________________________________________________________________________

                               Sean Walston
--------------------------------------------------------------------------
Willamette Hall, Office 317      SLD, Central Lab Annex, Office B-153
Department of Physics            Stanford Linear Accelerator Center, MS-94
University of Oregon             P.O. Box 4349
Eugene, OR 97403                 Stanford, CA 94309
walston@ampere.uoregon.edu       walston@SLAC.stanford.edu
Office:  541-346-4847            Office:  650-926-8768
Home:    541-686-9969            Mobile:  541-912-5456
__________________________________________________________________________



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:27 MET