Logo ROOT   6.18/05
Reference Guide
markerStyle.cxx
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_v7
3///
4/// \macro_code
5///
6/// \date 2018-03-18
7/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
8/// is welcome!
9/// \author Iliana Betsou
10
11#include "ROOT/RCanvas.hxx"
12#include "ROOT/RText.hxx"
13#include "ROOT/RMarker.hxx"
14#include "ROOT/RPadPos.hxx"
15#include <string>
16
17void markerStyle() {
18 using namespace ROOT::Experimental;
19
20 auto canvas = RCanvas::Create("Canvas Title");
21 double num = 0.3;
22
23 double x = 0;
24 double dx = 1/16.0;
25 for (Int_t i=1;i<16;i++) {
26 x += dx;
27
28 RPadPos pt1(RPadLength::Normal(x), .12_normal);
29 auto ot1 = canvas->Draw(RText(pt1, std::to_string(i)));
30 RPadPos pm1(RPadLength::Normal(x), .25_normal);
31 auto om1 = canvas->Draw(RMarker(pm1));
32 om1->SetStyle(i).SetSize(2.5);
33
34 RPadPos pt2(RPadLength::Normal(x), .42_normal);
35 auto ot2 = canvas->Draw(RText(pt2, std::to_string(i+19)));
36 RPadPos pm2(RPadLength::Normal(x), .55_normal);
37 auto om2 = canvas->Draw(RMarker(pm2));
38 om2->SetStyle(i+19).SetSize(2.5);
39
40 RPadPos pt3(RPadLength::Normal(x), .72_normal);
41 auto ot3 = canvas->Draw(RText(pt3, std::to_string(i+34)));
42 RPadPos pm3(RPadLength::Normal(x), .85_normal);
43 auto om3 = canvas->Draw(RMarker(pm3));
44 om3->SetStyle(i+34).SetSize(2.5);
45 }
46
47 canvas->Show();
48}
int Int_t
Definition: RtypesCore.h:41
A simple marker.
A text.
Double_t x[n]
Definition: legend1.C:17
A normalized coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the RPad.
Definition: RPadLength.hxx:77
A position (horizontal and vertical) in a RPad.
Definition: RPadPos.hxx:27