Changeset 1506
- Timestamp:
- 08/16/02 17:06:41 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r1505 r1506 544 544 gPad->Update(); 545 545 546 TPaveText *t = (TPaveText*)gPad->FindObject("title"); 547 if (t) 548 { 549 t->SetName((TString)"MHTitle"); // rename object 550 t->Clear(); // clear old lines 551 t->AddText((TString)" "+title+" "); // add the new title 552 t->SetBit(kCanDelete); // make sure object is deleted 553 554 // 555 // FIXME: This is a stupid workaround to hide the redrawn 556 // (see THistPainter::PaintTitle) title 557 // 558 gPad->Modified(); // indicates a change 559 gPad->Update(); // recreates the original title 560 t->Pop(); // bring our title on top 561 } 562 546 563 // 547 564 // Rename first statistics box … … 549 566 TPaveStats &s1 = *(TPaveStats*)gPad->FindObject("stats"); 550 567 s1.SetX1NDC(s1.GetX1NDC()-0.01); 551 s1.SetName( (TString)"Stat"+hist1.GetTitle());568 s1.SetName("MHStat"); 552 569 553 570 // … … 555 572 // 556 573 TH1 *h2 = (TH1*)((TH1&)hist2).DrawCopy("sames"); 557 558 574 gPad->Update(); 559 575 … … 570 586 const Int_t n = s1.GetListOfLines()->GetSize(); 571 587 const Double_t h = s1.GetY2NDC()-s1.GetY1NDC(); 572 TLegend &l = *new TLegend(s1.GetX1NDC(), 573 s1.GetY1NDC()-0.015-h*2/n, 574 s1.GetX2NDC(), 575 s1.GetY1NDC()-0.01 588 TLegend &l = *new TLegend(s1.GetX1NDC(), s1.GetY1NDC()-0.015-h*2/n, 589 s1.GetX2NDC(), s1.GetY1NDC()-0.01 576 590 ); 577 591 l.AddEntry(h1, h1->GetTitle()); … … 582 596 l.SetBit(kCanDelete); 583 597 584 // FIXME: Don't change the hist title. Change TPaveText::title585 h1->SetTitle(" "+title+" ");586 587 598 l.Draw(); 588 599 } … … 599 610 // 600 611 hist1.Draw(); 601 // FIXME: Don't change the hist title. Change TPaveText::title602 //h1->SetTitle(" "+title+" ");603 604 612 gPad->Update(); 613 614 TPaveText *t = (TPaveText*)gPad->FindObject("title"); 615 if (t) 616 { 617 t->SetName((TString)"MHTitle"); // rename object 618 t->Clear(); // clear old lines 619 t->AddText((TString)" "+title+" "); // add the new title 620 t->SetBit(kCanDelete); // make sure object is deleted 621 622 // 623 // FIXME: This is a stupid workaround to hide the redrawn 624 // (see THistPainter::PaintTitle) title 625 // 626 gPad->Modified(); // indicates a change 627 gPad->Update(); // recreates the original title 628 t->Pop(); // bring our title on top 629 } 605 630 606 631 //
Note:
See TracChangeset
for help on using the changeset viewer.