Hi Bernd, We do not have an option in TGraph to do directly what you want, but it is doable. See the script example in attachement. Note also that instead of calling TGraph(n,x,y); you can do TGraph(n,y,x); Rene Brun Bernd Reinhold wrote: > > Hi! > > How can I rotate and mirror the Axis of a TGraph. Default is: > y/\ > | > |-->x but I need: y<--| > | > \/x > > Thanks, Bernd. > > This was in the archive. But: How to do this? > > Support for this feature could be implemented for simple cases (TGraph or > TH1) > > On Thu, 5 Jul 2001, Rene Brun wrote: > > > Hi Harufumi, > > > > Plotting downwards is not implemented. > > Support for this feature could be implemented for simple cases (TGraph or > TH1) > > However, objects of these types with error bars and associated functions, > > annotations, log scales, etc would be more complex to support. > > The only solution that I see is to have this logic at the TPad level, but > > it would have side-effects for the annotations. > > > > Rene Brun > > > > Harufumi Tsuchiya wrote: > > > > > > Hi Rooters, > > > > > > I have the data from 14.0 to 28 along y axis and > > > I would like to plot the data from 28 to 14. > > > I succeeded in showing the decreasing number on y axis, > > > using TGaxis sample. > > > But, in this case, data points is plotted from 14 to 28. > > > > > > Here, I have a question. > > > Must I modify the original data points for plotting > > > on correct position or Is there a elegant way to make such > > > a plot using ROOT class ? > > > > > > Tkank for you helps. > > > > > > Harufumi Tsuchiya. > > void gminus () { c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); c1->SetGrid(); c1->SetTopMargin(0.15); const Int_t n = 20; Double_t x[n], y[n]; for (Int_t i=0;i<n;i++) { x[i] = -i*0.5; y[i] = -2+10*sin(x[i]+0.2); } gr = new TGraph(n,y,x); gr->SetMarkerStyle(21); gr->SetTitle("a rotated graph"); gr->Draw("ACP"); TH1 *frame = gr->GetHistogram(); gr->GetXaxis()->SetLabelOffset(99); gr->GetYaxis()->SetLabelOffset(99); c1->Update(); //draw an axis at the right side TGaxis *ar = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(), gPad->GetUxmax(), gPad->GetUymax(), gPad->GetUymin(), gPad->GetUymax(),510,"+L"); ar->Draw(); ar->SetTitle("the right axis title"); ar->CenterTitle(); //draw an axis at the top TGaxis *at = new TGaxis(gPad->GetUxmin(),gPad->GetUymax(), gPad->GetUxmax(), gPad->GetUymax(), gPad->GetUxmin(), gPad->GetUxmax(),510,"-"); at->Draw(); at->SetTitle("the top axis title"); at->CenterTitle(); }
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET