Read a 1-D histogram from a ROOT File and draw it.
We attach (or generate) the ROOT file in $ROOTSYS/tutorials/hsimple.root
or $PWD/hsimple.root
We draw one histogram in different formats.
{
"The pad with the function",0.03,0.62,0.50,0.92);
"The pad with the histogram",0.51,0.62,0.98,0.92);
"The pad with the histogram",0.03,0.02,0.97,0.57);
"Drawing options for one dimensional histograms");
pad1->GetFrame()->SetFillColor(18);
"Click on lego to rotate");
pave->AddText(
"Title and Stats pads");
pave->AddText(
"X and Y axis");
pave->AddText(
"You can modify bin contents");
}
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
TH1 is the base class of all histogram classes in ROOT.
The most important graphics class in the ROOT system.
A Pave (see TPave) with a text centered in the Pave.
void Draw(Option_t *option="") override
Draw this pavelabel with its current attributes.
A Pave (see TPave) with text, lines or/and boxes inside.
Base class for several text objects.
- Author
- Rene Brun
Definition in file h1ReadAndDraw.C.