I used these lines of code for plotting graph shown below using data available in data.txt file. In plot, the range of X-Axis is from 0 to 14,000 and I want to make 16,000 to 2000. What should I do to invert X-Axis?
graph1()
{
g = new TGraph(“data.txt”);
g->SetMarkerStyle(6);
g->SetTitle(“H-R Diagram;Temperature (K); Absolute Magitude”);
g->Draw(“AP”);
}
The ${ROOTSYS}/tutorials/hist/reverseaxis.C macro does NOT really reverse axes. It only draws “fake” reversed axes on top of the original plot (which is not reversed).