Re: [ROOT] problem in Y axis description

From: Jacek M. Holeczek (holeczek@us.edu.pl)
Date: Wed Apr 24 2002 - 11:32:23 MEST


Hi,

> Anyhow, for crazy cases like your example, you should not expect
> the automatic algorithms to always give a good result.

O.K. I have another "crazy" example ...
The following problem I have met MANY, MANY times ...
Observe :
	{
	Float_t x[3] = {1,2};
	Float_t y1[3] = {0.0001,0.002};
	TGraph *g = new TGraph(2, x, y1);
	TCanvas *cE = new TCanvas("cE", "cE");
	TPad *pad0 = new TPad("pad0", "My Pad", 0.01, 0.51, 0.50, 0.99);
	pad0->Draw(); cE->Update();
	pad0->cd(); cE->Modified(); cE->Update();
	g->Draw("AC");
	g->GetHistogram()->SetXTitle("A VERY NICELY LOOKING X AXIS TITLE");
	g->GetHistogram()->SetYTitle("A VERY NICELY LOOKING Y AXIS TITLE");
	pad0->Update(); pad0->Modified(); cE->Update();
	cE->SaveAs("cE.ps");
	}
See the attached gifs for the "default" result ...
I ALWAYS NEED to solve this MANUALLY using :
	MyGraph->GetHistogram()->GetXaxis()->SetTitleOffset(MagicXValue);
	MyGraph->GetHistogram()->GetYaxis()->SetTitleOffset(MagicYValue);

I vote for solving this problem in a way that by "default" it will never
appear, so that a casual user does not get this problem at all.

Best regards,
Jacek.



NiceXAxisDescription.gif
NiceYAxisDescription.gif



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET