#include "ROOT/RFrameTitle.hxx"
#include "ROOT/RMarker.hxx"
auto symlog_style = RStyle::Parse("frame { margins_left: 0.1; }"
"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 canvas = RCanvas::Create("Drawing with 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++) {
if (
n % 27 == 0) {
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");
}
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();
}
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TRandom * gRandom
A position (horizontal and vertical) in a RPad.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.