Logo ROOT   6.18/05
Reference Guide
lineStyle.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/RColor.hxx"
13#include "ROOT/RText.hxx"
14#include "ROOT/RLine.hxx"
15#include "ROOT/RPadPos.hxx"
16#include <string>
17
18void lineStyle() {
19 using namespace ROOT::Experimental;
20
21 auto canvas = RCanvas::Create("Canvas Title");
22 double num = 0.3;
23
24 for (int i=10; i>0; i--){
25 num = num + 0.05;
26
27 RPadPos pt(.3_normal, RPadLength::Normal(num));
28 auto optts = canvas->Draw(RText(pt, std::to_string(i)));
29 optts->SetSize(13).SetAlign(32).SetFont(52);
30
31 RPadPos pl1(.32_normal, RPadLength::Normal(num));
32 RPadPos pl2(.8_normal , RPadLength::Normal(num));
33 auto optls = canvas->Draw(RLine(pl1, pl2));
34 optls->SetStyle(i);
35 }
36
37 canvas->Show();
38}
A text.
TPaveText * pt
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