I’m new here and I’m having some trouble with root for university stuff. I’ve got to draw a graph of Counts vs HV for a drift chamber. I’ve got two vectors, one for high voltage applied and one for the corresponding counts (I have to show the temporal spectrum and compare the experimental one with the theorethical). The problem is that the values shown in the X axis are not the one i used in the vector. Here’s some parts of the code.
[quote]TCanvas*c1=new TCanvas(“c1”, “dN/dt experimentVStheory”, 200, 10, 1200, 800);
TMultiGraph mg = new TMultiGraph();
TGraph*gr2=new TGraph(n,v,t); gr2->SetMarkerStyle(22); gr2->SetMarkerColor(kBlue); mg->Add(gr2, "C"); mg->SetTitle("Counts vs HV;HV(V);Counts"); mg->Draw("AP");[/quote]
where n is the number of entry in each vector, v is the vector of voltages, s the one of experimental counts and t the one of theorethical. I need the experimantal graph to appear in bars while for the theorethical i need a continuous line.
In the X Axis i would display just the values in v (for example 550, 750 and so on) while the autolabel displays 200-400…