[ROOT] gPad->SaveAs("xxx.C") bug and possible fix

From: Andre Holzner (Andre.Holzner@cern.ch)
Date: Wed May 08 2002 - 19:04:36 MEST


Hello,

I have a simple plot (of a histgram) where I have the 
(alphanumeric) bin labels on the x axis drawn vertically.

When I save it as a C macro using gPad->SaveAs()
and reload it later,

 - the bin labels are not drawn vertically any more
 - the axis titles are not centered any more.

I could fix this by adding the following lines in
$ROOTSYS/hist/src/TAxis.cxx in the method void
TAxis::SaveAttributes(...),
just before the last statement
TAttAxis::SaveAttributes(out,name,subname) :

   if (TestBit(kLabelsHori)) {
      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsHori);"<<endl;
     }

   if (TestBit(kLabelsVert)) {
      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsVert);"<<endl;
     }

   if (TestBit(kLabelsDown)) {
      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsDown);"<<endl;
     }

   if (TestBit(kLabelsUp)) {
      out<<"   "<<name<<subname<<"->SetBit(TAxis::kLabelsUp);"<<endl;
     }

   if (TestBit(kCenterTitle)) {
      out<<"   "<<name<<subname<<"->CenterTitle(true);"<<endl;
     }


(if you want, I can create a patch file against the CVS of today). 
Maybe there are also other bits which should be checked..

best regards,

André

-- 
------------------+----------------------------------
Andre Holzner     | +41 22 76 76750 
Bureau 32 2-C13   | Building 32     
CERN              | Office 2-C13    
CH-1211 Geneve 23 | http://wwweth.cern.ch/~holzner/



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