ROOT
git-r3/HEAD
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
18
void
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
}
RCanvas.hxx
ROOT::Experimental::RAttrFont::kArialOblique
@ kArialOblique
Definition
RAttrFont.hxx:41
ROOT::Experimental::RAttrText::kRightCenter
@ kRightCenter
Definition
RAttrText.hxx:41
ROOT::Experimental::RCanvas::Create
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Definition
RCanvas.cxx:89
ROOT::Experimental::RPadPos
A position (horizontal and vertical) in a RPad.
Definition
RPadPos.hxx:28
text
TText * text
Definition
entrylist_figure1.C:10
ROOT::Experimental
Namespace for ROOT features in testing.
Definition
TROOT.h:100
tutorials
visualisation
rcanvas
rline_width.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1