Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
rline_width.cxx
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_rcanvas
3///
4/// This ROOT 7 example shows the various line widths.
5///
6/// \macro_image (rcanvas_js)
7/// \macro_code
8///
9/// \date 2018-03-18
10/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
11/// is welcome!
12/// \authors Iliana Betsou, Sergey Linev
13
14#include "ROOT/RCanvas.hxx"
15#include "ROOT/RText.hxx"
16#include "ROOT/RLine.hxx"
17
18void rline_width()
19{
20 using namespace ROOT::Experimental;
21
22 auto canvas = RCanvas::Create("Different line widths");
23 double num = 0.3;
24
25 for (int i = 10; i > 0; i--){
26 num = num + 0.05;
27
28 auto text = canvas->Add<RText>(RPadPos(.3_normal, 1_normal*num), std::to_string(i));
29 text->text.size = 0.04;
30 text->text.align = RAttrText::kRightCenter;
31 text->text.font = RAttrFont::kArialOblique;
32
33 auto draw = canvas->Add<RLine>(RPadPos(.32_normal, 1_normal*num), RPadPos(.8_normal, 1_normal*num));
34 draw->line.width = i;
35 }
36
37 canvas->Show();
38}
Option_t Option_t TPoint TPoint const char text
A position (horizontal and vertical) in a RPad.
Definition RPadPos.hxx:28