On Mon, 20 Dec 1999, Mariusz Stanczak wrote:
> Hello,
> Having tried the time option "t", I came to conclusion that either I'm
> clueless as to how to apply it, or this part of the class is broken. For
> example specifying;
> TGaxis *axis = new TGaxis(1996, 10, 2000, 10, 1997, 1999, 3,"t");
> axis->SetTimeFormat("%Y")
Hi Mariusz,
start and end time must be in time_t format, the following little macro
illustrates this:
{
gROOT->Reset();
TCanvas ca("cc","cc");
gStyle->SetTimeOffset(0);
TDatime start(2000, 2, 26, 0, 0, 0);
TDatime end( 2000, 3, 3, 0, 0, 0);
UInt_t start_t = start.Convert();
UInt_t end_t = end.Convert();
cout << "From: " << start.AsString()
<< " to: " << end.AsString() << endl;
TGaxis a(0.1, 0.1, 0.9, 0.1, start_t, end_t, 1010, "t");
a.SetTimeFormat("%a");
a.Draw();
TGaxis b(0.1, 0.3, 0.9, 0.3, start_t, end_t, 1010, "t");
b.SetTimeFormat("%d");
b.Draw();
TGaxis c(0.1, 0.5, 0.9, 0.5, start_t, end_t, 110, "t");
c.SetTimeFormat("%x");
c.Draw();
}
Merry Christmas and happy 2000 to everybody,
Cheers
Otto
----------------------------------------------------------------------------
Otto Schaile Sektion Physik der LMU Muenchen
Phone: (+49 89)289 14070 Am Coulombwall 1, D-85748 Garching, Germany
FAX: (+49 89)289 14072 EMail: Otto.Schaile@Physik.Uni-Muenchen.DE
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET