Dear everyone,
Hi there!
I am a master course student studying high energy physics in Japan.
I quite often use the “ROOT”, it’s absolutely wonderful tool.
By the way, I couldn’t use a “SetRangeUser” function in under case.
If someone know the reason, please teach me.
P.S.
I tried under codes on ROOT 3.03 on Linux and 5.10 on Windows XP.
5.10 on XP works only Y axis.
commands:
$root -l
ROOT[0].X Sample.cxx
codes:
#include “TROOT.h”
#include "TRint.h"
gROOT->Reset();
void Sample (void) {
const Int_t number_of_data = 3;
Double_t x_data[number_of_data] = {
35.0,
39.0,
190.0
};
Double_t y_data[number_of_data] = {
260.0,
200.0,
90.0
};
TGraph *graph = new TGraph (
number_of_data,
x_data,
y_data
);
TCanvas c1 = new TCanvas (“c1”, “Test”, 200, 10, 600, 400);
graph->SetMarkerStyle (2);
graph->Draw (“AP”);
/ Why doesn’t the under lines work? */
graph->GetXaxis ()->SetRangeUser (0.0, 200.0);
graph->GetYaxis ()->SetRangeUser (0.0, 300.0);
graph->Draw (“AP”);
c1->Update();
}