File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3812,6 +3812,8 @@ void zoomfit()
38123812void hbars ()
38133813{
38143814 TCanvas *C = StartTest (700 ,800 );
3815+ TDirectory dir (" hbars_dir" , " Directory for the hbars test" );
3816+ TDirectory::TContext dirCtx{&dir};
38153817
38163818 TTree *T = (TTree*)gCernstaff ->Get (" T" );
38173819 T->SetFillColor (45 );
@@ -3825,10 +3827,10 @@ void hbars()
38253827 // vertical bar chart
38263828 C->cd (2 ); gPad ->SetGrid (); gPad ->SetFrameFillColor (33 );
38273829 T->Draw (" Division>>hDiv" ," " ," goff" );
3828- TH1F *hDiv = (TH1F*)gDirectory -> Get (" hDiv" );
3830+ TH1F *hDiv = (TH1F*)dir. Get (" hDiv" );
38293831 hDiv->SetStats (0 );
38303832 TH1F *hDivFR = (TH1F*)hDiv->Clone (" hDivFR" );
3831- hDivFR->SetDirectory (gDirectory );
3833+ hDivFR->SetDirectory (&dir );
38323834 T->Draw (" Division>>hDivFR" ," Nation==\" FR\" " ," goff" );
38333835 hDiv->SetBarWidth (0.45 );
38343836 hDiv->SetBarOffset (0.1 );
You can’t perform that action at this time.
0 commit comments