This macro generates a small RH3D, fills it with random values and draw it in RCanvas, using configured web browser.
#include "ROOT/RFrameTitle.hxx"
void rh3()
{
auto pHist = std::make_shared<RH3D>(xaxis, yaxis, zaxis);
for (
int n=0;
n<10000;
n++)
pHist->Fill({gRandom->Gaus(0.,2.), gRandom->Gaus(0.,2.), gRandom->Gaus(0.,2.)});
auto canvas = RCanvas::Create("RH3D drawing options");
auto subpads = canvas->Divide(2,2);
subpads[0][0]->Draw<RFrameTitle>("Box(0) default draw option");
subpads[0][0]->Draw(pHist)->Box(0).fill =
RAttrFill(RColor::kBlue, RAttrFill::kSolid);
subpads[1][0]->Draw<RFrameTitle>("Sphere(1) draw option");
subpads[1][0]->Draw(pHist)->Sphere(1);
subpads[0][1]->Draw<RFrameTitle>("Color() draw option");
subpads[0][1]->Draw(pHist)->Color();
subpads[1][1]->Draw<RFrameTitle>("Scatter() draw option");
subpads[1][1]->Draw(pHist)->Scatter().fill =
RAttrFill(RColor::kBlack, RAttrFill::kSolid);
canvas->SetSize(1000, 700);
canvas->Show();
}
#define R__LOAD_LIBRARY(LIBRARY)
Drawing fill attributes for different objects.
Objects used to configure the different axis types.
- Date
- 2020-06-18
- 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 rh3.cxx.