Custom XAxis on a Multigraph

Hi,
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);
c1->SetGrid();
TMultiGraph mg = new TMultiGraph();
TGraph
gr1=new TGraph(n,v,s);
mg->Add(gr1,“B”);

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…

By default the number of divisions along axis is optimised to show “nice” labelling.
You can suppress the optimisation by defining a negative number go divisions:

mg->GetHistogram()->GetXaxis()->SetNdivisions(-510);

root.cern.ch/doc/master/classTA … 91cbd84084