This macro generates a small V7 TH2D, fills it with random values and draw it in a V7 canvas, using configured web browser.
#include "ROOT/RFrameTitle.hxx"
void draw_rh2_colz()
{
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("Canvas Title");
auto frame = canvas->GetOrCreateFrame();
frame->Margins().SetRight(0.2_normal);
frame->SetGridX(false).SetGridY(false);
frame->SetTicksX(2).SetTicksY(2);
frame->AttrX().SetZoom(2.,8.);
frame->AttrY().SetZoom(2.,8.);
canvas->Draw<RFrameTitle>("2D histogram with color palette")->SetMargin(0.01_normal).SetHeight(0.09_normal);
auto draw = canvas->Draw(pHist);
draw->Color();
draw->Text(true);
canvas->SetSize(1000, 700);
canvas->Show();
}
#define R__LOAD_LIBRARY(LIBRARY)
RAttrFill & SetColor(const RColor &color)
The fill color.
Objects used to configure the different axis types.
A color palette draw near the frame.
- Date
- 2020-03-04
- 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 draw_rh2_colz.cxx.