On Wed, 22 Dec 1999 15:44:31 +0100 (CET), Otto Schaile wrote:
Thank you Otto for the code. As it happens my data is time stamped in
time_t format so following your examples I did get the data synched with the
axis... it is quirky.
Thanks,
/Mariusz
>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
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:16 MET