This macro generates really large RH2D histogram, fills it with predefined pattern and draw it in a RCanvas, using Optmize() drawing mode.
#include "ROOT/RFrameTitle.hxx"
void rh3_large()
{
const int nbins = 200;
auto pHist = std::make_shared<RH3D>(xaxis, yaxis, zaxis);
for(int i=0;i<nbins;++i)
for(int j=0;j<nbins;++j)
for(int k=0;k<nbins;++k)
pHist->Fill({1.*i,1.*j,1.*k}, i+j+k);
auto canvas = RCanvas::Create("Large 200x200x200 RH3 drawing");
auto frame = canvas->AddFrame();
frame->x.zoomMin = nbins*0.1;
frame->x.zoomMax = nbins*0.9;
frame->y.zoomMin = nbins*0.1;
frame->y.zoomMax = nbins*0.9;
frame->z.zoomMin = nbins*0.1;
frame->z.zoomMax = nbins*0.9;
canvas->Draw<RFrameTitle>(
TString::Format(
"Large RH3D histogram with %d x %d x %d bins",nbins,nbins,nbins).
Data());
auto draw = canvas->Draw(pHist);
draw->line.color = RColor::kLime;
draw->Scatter();
draw->optimize = true;
canvas->SetSize(1000, 700);
canvas->Show();
}
Objects used to configure the different axis types.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
- Date
- 2020-06-26
- 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_large.cxx.