Log plot problem

Hi,

Please try running this macro. For some reason, I can’t use log scales properly on the axes using the data read in from the attached text file. The macro is also attached, as well as a gnuplot output file with the correct look (what I want to see). How can I make the ROOT macro output something like the gnuplot output (attached ps file)?

Curtis
flux.10_0.01.txt (2.54 KB)
flux.ps (15.6 KB)
test2.C (813 Bytes)

I have considerably simplified your code as show below

Rene

[code]void test2a(char *infile=“flux.10_0.01.txt”) {
TGraph *gr1 = new TGraph(infile);
gr1->SetLineStyle(2);
gr1->SetLineColor(kGreen);

TCanvas *c1 = new TCanvas(“c1”,“c1”,800,600);
c1->cd();
gPad->SetLogx();
gPad->SetLogy();
TH1F *frame = c1->DrawFrame(1,1,1000,10000);
frame->SetTitle("#Gamma-ray integral flux versus luminosity");
gr1->Draw(“LP”);
}[/code]

Hi,

And what shall I do if I want to draw on the same plot data from different files like flux.10_0.01.txt ?
Thank you very much,

Sabrina

[quote=“brun”]I have considerably simplified your code as show below

Rene

[code]void test2a(char *infile=“flux.10_0.01.txt”) {
TGraph *gr1 = new TGraph(infile);
gr1->SetLineStyle(2);
gr1->SetLineColor(kGreen);

TCanvas *c1 = new TCanvas(“c1”,“c1”,800,600);
c1->cd();
gPad->SetLogx();
gPad->SetLogy();
TH1F *frame = c1->DrawFrame(1,1,1000,10000);
frame->SetTitle("#Gamma-ray integral flux versus luminosity");
gr1->Draw(“LP”);
}[/code][/quote]

Hi Sabrina,

Simply create a TGraph object for each file

Rene