Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
lineWidth.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 lineWidth()
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 // one can create object ourself
26 canvas->Draw(std::make_shared<RText>(RPadPos(.3_normal, 1_normal*num), std::to_string(i)))->AttrText().SetSize(13).SetAlign(32).SetFont(52);
27
28 // or let it create by templated Draw<T> method
29 canvas->Draw<RLine>(RPadPos(.32_normal, 1_normal*num), RPadPos(.8_normal , 1_normal*num))->AttrLine().SetWidth(i);
30 }
31
32 canvas->Show();
33}
A position (horizontal and vertical) in a RPad.
Definition RPadPos.hxx:28