This ROOT 7 example demonstrates how to create a ROOT 7 canvas (RCanvas), divide on sub-sub pads and draw histograms there.
void subpads()
{
auto pHist1 = std::make_shared<RH1D>(xaxis);
auto pHist2 = std::make_shared<RH1D>(xaxis);
auto pHist3 = std::make_shared<RH1D>(xaxis);
for (
int n = 0;
n < 1000;
n++) {
pHist1->Fill(
gRandom->Gaus(3., 0.8));
pHist2->Fill(
gRandom->Gaus(5., 1.));
pHist3->Fill(
gRandom->Gaus(7., 1.2));
}
auto subpads = canvas->Divide(2,2);
auto subsubpads = subpads[1][1]->Divide(2,2);
"frame {"
" gridX: true;"
" gridY: true;"
" ticksX: 2;"
" ticksY: 2;"
" x_labels_size: 0.05;"
" y_labels_size: 20;"
" y_labels_color: green;"
"}");
canvas->SetSize(1200, 600);
canvas->Show();
canvas->ClearOnClose(
style);
}
R__EXTERN TRandom * gRandom
Objects used to configure the different axis types.
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kRed
static R__DLLEXPORT constexpr RGB_t kGreen
static R__DLLEXPORT constexpr RGB_t kBlue
static std::shared_ptr< RStyle > Parse(const std::string &css_code)
Parse CSS code and returns std::shared_ptr<RStyle> when successful.
- Date
- 2018-03-13
- 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 subpads.cxx.