I have a code below to create a canvas and draw a histogram with a set X and Y axis on that canvas. It doesn’t draw the histogram part just the canvas.
[code]void ComparingMediums()
{
//Create the canvas
TCanvas* my_canvas = new TCanvas(“my_canvas”, “FIXED AXIS”, 200, 10, 600, 400);
TH1 *hist = new TH1("hist", "New Plot", 350, 0., 320., 20, 0., -10.);
hist->Draw(); //Draw histogram
}[/code]
I get an error that says: Can’t call TH1::TH1(“hist”, “New Plot”, 350, 0., 320., 20, 0., -10.) in current scope.
What I’m trying to do now is to show a canvas and have the x axis and y axis with certain parameters and number of bins. I don’t understand why my code below won’t work. I’m still new to ROOT, and maybe I’m doing something obviously wrong.