This macro generates two RH1D, fills them and draw in RCanvas.
Second histogram uses enables "secondy" attribute to draw separate Y axis on right side
#include "ROOT/RFrameTitle.hxx"
{
auto canvas = RCanvas::Create("RH1 with two Y scales");
auto col1 = RColor::kRed,
col2 = RColor::kBlue;
canvas->Draw<
RFrameTitle>(
"Two independent Y axes for histograms");
canvas->GetFrame()->y.ticks.color =
col1;
canvas->GetFrame()->y2.ticks.color =
col2;
canvas->SetSize(800, 600);
canvas->Show();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TRandom * gRandom
Objects used to configure the different axis types.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
- Date
- 2021-05-17
- 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 rh1_twoscales.cxx.