24#include "ROOT/RFrameTitle.hxx"
26#include "ROOT/RMarker.hxx"
30auto symlog_style =
RStyle::Parse(
"frame { margins_left: 0.1; }"
31 "title { margin: 0.01; height: 0.1; }"
32 "marker { onframe: true; clipping: true; }"
33 ".group1 { marker_style: 8; marker_color: blue; }"
34 ".group2 { marker_style: 8; marker_color: orange; }");
41 auto pads = canvas->Divide(1, 3);
44 auto frame1 = pads[0][0]->AddFrame();
45 frame1->drawAxes =
true;
48 frame1->x.title =
"x linear";
49 frame1->x.title.SetCenter();
53 frame1->y.title =
"y log";
54 frame1->y.title.SetCenter();
55 pads[0][0]->Draw<RFrameTitle>(
"linear scale");
58 auto frame2 = pads[0][1]->AddFrame();
59 frame2->drawAxes =
true;
62 frame2->x.max = 1.2e3;
63 frame2->x.title =
"x log";
64 frame2->x.title.SetCenter();
68 frame2->y.title =
"y log";
69 frame2->y.title.SetCenter();
70 pads[0][1]->Draw<RFrameTitle>(
"log scale, missing points");
73 auto frame3 = pads[0][2]->AddFrame();
74 frame3->drawAxes =
true;
76 frame3->x.symlog = 10.;
78 frame3->x.max = 1.2e3;
79 frame3->x.title =
"x symlog";
80 frame3->x.title.SetCenter();
84 frame3->y.title =
"y log";
85 frame3->y.title.SetCenter();
86 pads[0][2]->Draw<RFrameTitle>(
"symlog scale");
88 for (
int n = 0;
n < 100;
n++) {
98 pads[0][0]->Draw<RMarker>(pm)->SetCssClass(
"group1");
99 pads[0][1]->Draw<RMarker>(pm)->SetCssClass(
"group1");
100 pads[0][2]->Draw<RMarker>(pm)->SetCssClass(
"group1");
103 for (
int n = 0;
n < 75;
n++) {
104 auto x2 =
gRandom->Uniform(-5., 5.);
108 pads[0][0]->Draw<RMarker>(pm)->SetCssClass(
"group2");
109 pads[0][1]->Draw<RMarker>(pm)->SetCssClass(
"group2");
110 pads[0][2]->Draw<RMarker>(pm)->SetCssClass(
"group2");
113 canvas->UseStyle(symlog_style);
115 canvas->SetSize(500, 900);
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.