Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
arrows.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_graphics
3/// \notebook -js
4/// \preview Draw arrows.
5///
6/// \macro_image (tcanvas_js)
7/// \macro_code
8///
9/// \author Rene Brun
10
11void arrows()
12{
13 auto c1 = new TCanvas("c1");
14 c1->Range(0, 0, 1, 1);
15
16 auto par = new TPaveLabel(0.1, 0.8, 0.9, 0.95, "Examples of various arrows formats");
17 par->SetFillColor(42);
18 par->Draw();
19
20 auto ar1 = new TArrow(0.1, 0.1, 0.1, 0.7);
21 ar1->Draw();
22 auto ar2 = new TArrow(0.2, 0.1, 0.2, 0.7, 0.05, "|>");
23 ar2->SetAngle(40);
24 ar2->SetLineWidth(2);
25 ar2->Draw();
26 auto ar3 = new TArrow(0.3, 0.1, 0.3, 0.7, 0.05, "<|>");
27 ar3->SetAngle(40);
28 ar3->SetLineWidth(2);
29 ar3->Draw();
30 auto ar4 = new TArrow(0.46, 0.7, 0.82, 0.42, 0.07, "|>");
31 ar4->SetAngle(60);
32 ar4->SetLineWidth(2);
33 ar4->SetFillColor(2);
34 ar4->Draw();
35 auto ar5 = new TArrow(0.4, 0.25, 0.95, 0.25, 0.15, "<|>");
36 ar5->SetAngle(60);
37 ar5->SetLineWidth(4);
38 ar5->SetLineColor(4);
39 ar5->SetFillStyle(3008);
40 ar5->SetFillColor(2);
41 ar5->Draw();
42}
Draw all kinds of Arrows.
Definition TArrow.h:29
The Canvas class.
Definition TCanvas.h:23
A Pave (see TPave) with a text centered in the Pave.
Definition TPaveLabel.h:20
return c1
Definition legend1.C:41