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 auto c1 = new TCanvas("c1");
13 c1->Range(0,0,1,1);
14
15 auto par = new TPaveLabel(0.1,0.8,0.9,0.95,"Examples of various arrows formats");
16 par->SetFillColor(42);
17 par->Draw();
18
19 auto ar1 = new TArrow(0.1,0.1,0.1,0.7);
20 ar1->Draw();
21 auto ar2 = new TArrow(0.2,0.1,0.2,0.7,0.05,"|>");
22 ar2->SetAngle(40);
23 ar2->SetLineWidth(2);
24 ar2->Draw();
25 auto ar3 = new TArrow(0.3,0.1,0.3,0.7,0.05,"<|>");
26 ar3->SetAngle(40);
27 ar3->SetLineWidth(2);
28 ar3->Draw();
29 auto ar4 = new TArrow(0.46,0.7,0.82,0.42,0.07,"|>");
30 ar4->SetAngle(60);
31 ar4->SetLineWidth(2);
32 ar4->SetFillColor(2);
33 ar4->Draw();
34 auto ar5 = new TArrow(0.4,0.25,0.95,0.25,0.15,"<|>");
35 ar5->SetAngle(60);
36 ar5->SetLineWidth(4);
37 ar5->SetLineColor(4);
38 ar5->SetFillStyle(3008);
39 ar5->SetFillColor(2);
40 ar5->Draw();
41}
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