Logo ROOT   6.14/05
Reference Guide
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/TCanvas.hxx"
12 #include "ROOT/TColor.hxx"
13 #include "ROOT/TText.hxx"
14 #include "ROOT/TLine.hxx"
15 #include "ROOT/TPadPos.hxx"
16 
17 
18 void lineWidth() {
19  using namespace ROOT;
20  using namespace ROOT::Experimental;
21 
22  auto canvas = Experimental::TCanvas::Create("Canvas Title");
23  double num = 0.3;
24 
25  for (int i=10; i>0; i--){
26  num = num + 0.02;
27 
28  TPadPos pt(.3_normal, TPadLength::Normal(num));
29  auto optts = canvas->Draw(Experimental::TText(pt, Form("%d", i)));
30  optts->SetTextSize(13);
31  optts->SetTextAlign(32);
32  optts->SetTextFont(52);
33 
34  TPadPos pl1(.32_normal, TPadLength::Normal(num));
35  TPadPos pl2(.8_normal , TPadLength::Normal(num));
36  auto optls = canvas->Draw(Experimental::TLine(pl1, pl2));
37  optls->SetLineWidth(i);
38  }
39 
40  canvas->Show();
41 }
A normalized coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the TPad...
Definition: TPadLength.hxx:75
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
A position (horizontal and vertical) in a TPad.
Definition: TPadPos.hxx:27
TPaveText * pt
char * Form(const char *fmt,...)
static std::shared_ptr< TCanvas > Create(const std::string &title)
Definition: TCanvas.cxx:74