Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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/RText.hxx"
13#include "ROOT/RLine.hxx"
14
15void lineStyle()
16{
17 using namespace ROOT::Experimental;
18
19 auto canvas = RCanvas::Create("Canvas Title");
20 double num = 0.3;
21
22 for (int i=10; i>0; i--){
23 num = num + 0.05;
24
25 canvas->Draw<RText>(std::to_string(i))->SetPos({.3_normal, 1_normal*num}).AttrText().SetSize(13).SetAlign(32).SetFont(52);
26
27 canvas->Draw<RLine>()->SetP1({.32_normal,1_normal*num}).SetP2({.8_normal, 1_normal*num}).AttrLine().SetStyle(i);
28 }
29
30 canvas->Show();
31}