Something simple

I’ve only been using root for a little while. I would like to plot multiple functions on one graph, however I can’t seem to get it to work, I am using the below to plot a single function, any help would be much appreciated.

{

gROOT->Reset();
c1 = new TCanvas(“sectheta”,“R”,200,10,700,500);

c1->SetGridx();
c1->SetGridy();

TH1F *hr = c1->DrawFrame(0,0,2000,900);

fun1 = new TF1(“fun1”,“40+0.2794*x”,0,2000);

fun1->Draw();

}

Cheers,

Chris

Hi Chris,

Have a look at tutorials/multigraph.C and use the
TGraph(const TF1* f, Option_t* option) constructor.

Eddy

Cheers, got it working now, thanks for the help.

Chris