#include "ROOT/RFrameTitle.hxx"
#include "ROOT/RMarker.hxx"
"title { margin: 0.01; height: 0.1; }"
"marker { onframe: true; clipping: true; }"
".group1 { marker_style: 8; marker_color: blue; }"
".group2 { marker_style: 8; marker_color: orange; }");
void symlog()
{
auto pads = canvas->Divide(1, 3);
auto frame1 = pads[0][0]->AddFrame();
frame1->drawAxes = true;
frame1->x.min = -40;
frame1->x.max = 1040;
frame1->x.title = "x linear";
frame1->x.title.SetCenter();
frame1->y.log = 10.;
frame1->y.min = 1;
frame1->y.max = 1e4;
frame1->y.title = "y log";
frame1->y.title.SetCenter();
pads[0][0]->Draw<RFrameTitle>("linear scale");
auto frame2 = pads[0][1]->AddFrame();
frame2->drawAxes = true;
frame2->x.log = 10.;
frame2->x.min = 0.05;
frame2->x.max = 1.2e3;
frame2->x.title = "x log";
frame2->x.title.SetCenter();
frame2->y.log = 10.;
frame2->y.min = 1;
frame2->y.max = 1e4;
frame2->y.title = "y log";
frame2->y.title.SetCenter();
pads[0][1]->Draw<RFrameTitle>("log scale, missing points");
auto frame3 = pads[0][2]->AddFrame();
frame3->drawAxes = true;
frame3->x.symlog = 10.;
frame3->x.min = -10;
frame3->x.max = 1.2e3;
frame3->x.title = "x symlog";
frame3->x.title.SetCenter();
frame3->y.log = 10.;
frame3->y.min = 1;
frame3->y.max = 1e4;
frame3->y.title = "y log";
frame3->y.title.SetCenter();
pads[0][2]->Draw<RFrameTitle>("symlog scale");
for (
int n = 0;
n < 100;
n++) {
x1 = 100;
y1 *= 100;
}
pads[0][0]->Draw<RMarker>(pm)->SetCssClass("group1");
pads[0][1]->Draw<RMarker>(pm)->SetCssClass("group1");
pads[0][2]->Draw<RMarker>(pm)->SetCssClass("group1");
}
for (
int n = 0;
n < 75;
n++) {
auto x2 =
gRandom->Uniform(-5., 5.);
pads[0][0]->Draw<RMarker>(pm)->SetCssClass("group2");
pads[0][1]->Draw<RMarker>(pm)->SetCssClass("group2");
pads[0][2]->Draw<RMarker>(pm)->SetCssClass("group2");
}
canvas->UseStyle(symlog_style);
canvas->SetSize(500, 900);
canvas->Show();
}
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
A position (horizontal and vertical) in a RPad.
static std::shared_ptr< RStyle > Parse(const std::string &css_code)
Parse CSS code and returns std::shared_ptr<RStyle> when successful.
Namespace for ROOT features in testing.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.