{ auto c1 = new TCanvas("c1","c1",600,400); auto hb1 = new TH2F("hb1","Example of BOX plots with option SAME ",40,-3,3,40,-3,3); auto hb2 = new TH2F("hb2","hb2",40,-3,3,40,-3,3); auto hb3 = new TH2F("hb3","hb3",40,-3,3,40,-3,3); auto hb4 = new TH2F("hb4","hb4",40,-3,3,40,-3,3); for (Int_t i=0;i<1000;i++) { double x,y; gRandom->Rannor(x,y); if (x>0 && y>0) hb1->Fill(x,y,4); if (x<0 && y<0) hb2->Fill(x,y,3); if (x>0 && y<0) hb3->Fill(x,y,2); if (x<0 && y>0) hb4->Fill(x,y,1); } hb1->SetFillColor(1); hb2->SetFillColor(2); hb3->SetFillColor(3); hb4->SetFillColor(4); hb1->Draw("box"); hb2->Draw("box same"); hb3->Draw("box same"); hb4->Draw("box same"); }