invert an axis

From: Roger Mason <rmason_at_esd.mun.ca>
Date: Sat, 15 Mar 2008 18:28:05 -0230


Hello,

I'd like to reverse the y axis of a TGraph so the numbers increase downwards. Can this be done without making them negative? If not, is there a way to remove the minus signs from the tick labels?

If it makes a difference here is the code fragment that plots the graph:

(other parts of arrays z and y filled elsewhere)...   T0 = cg0->Eval(z[40]);
  cg0->SetParameters(T0,2.6E-8,3.35,17E-3,40);   for (Int_t i=40; i<200; i++) {
  z[i] = i;
  y[i] = cg0->Eval(z[i]);
  }

  TGraph *gcg = new TGraph(200,y,z);

  gcg->SetLineColor(4);
  gcg->SetLineWidth(3);
  //  gcg->SetLabel();
  gcg->GetXaxis()->SetTitle("Temperature");
  gcg->GetYaxis()->SetTitle("Depth");
  gcg->Draw("AL");

I'm using 5.18/00 on Gentoo Linux.

Thanks,
Roger Received on Sat Mar 15 2008 - 22:07:29 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 17 2008 - 11:50:01 CET