This macro generates RH2D and draw it with different options in RCanvas.
#include "ROOT/RFrameTitle.hxx"
void rh2()
{
auto pHist = std::make_shared<RH2D>(xaxis, yaxis);
for (
int n=0;
n<10000;
n++)
pHist->Fill({gRandom->Gaus(5.,2.), gRandom->Gaus(5.,2.)});
auto canvas = RCanvas::Create("RH2 drawing options");
auto subpads = canvas->Divide(2,3);
subpads[0][0]->Draw<RFrameTitle>("Color() draw option (default)");
subpads[0][0]->Draw(pHist);
subpads[1][0]->Draw<RFrameTitle>("Contour() draw option");
subpads[1][0]->Draw(pHist)->Contour();
subpads[0][1]->Draw<RFrameTitle>("Text() draw option");
subpads[0][1]->Draw(pHist)->Text().text.color = RColor::kBlue;
subpads[1][1]->Draw<RFrameTitle>("Arrow() draw option");
auto draw11 = subpads[1][1]->Draw(pHist);
draw11->Arrow();
draw11->line.color = RColor::kRed;
subpads[0][2]->Draw<RFrameTitle>("Lego() draw option");
subpads[0][2]->Draw(pHist)->Lego(2);
subpads[1][2]->Draw<RFrameTitle>("Surf() draw option");
subpads[1][2]->Draw(pHist)->Surf(2);
canvas->SetSize(1000, 700);
canvas->Show();
}
Objects used to configure the different axis types.
- Date
- 2020-06-25
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Sergey Linev s.lin.nosp@m.ev@g.nosp@m.si.de
Definition in file rh2.cxx.