ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
arrow.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphics
3 /// Draw arrows.
4 ///
5 /// \macro_image
6 /// \macro_code
7 ///
8 /// \author Rene Brun
9 
10 TCanvas *arrow(){
11  TCanvas *c1 = new TCanvas("c1");
12  c1->Range(0,0,1,1);
13 
14  TPaveLabel *par = new TPaveLabel(0.1,0.8,0.9,0.95,"Examples of various arrow formats");
15  par->SetFillColor(42);
16  par->Draw();
17 
18  TArrow *ar1 = new TArrow(0.1,0.1,0.1,0.7);
19  ar1->Draw();
20  TArrow *ar2 = new TArrow(0.2,0.1,0.2,0.7,0.05,"|>");
21  ar2->SetAngle(40);
22  ar2->SetLineWidth(2);
23  ar2->Draw();
24  TArrow *ar3 = new TArrow(0.3,0.1,0.3,0.7,0.05,"<|>");
25  ar3->SetAngle(40);
26  ar3->SetLineWidth(2);
27  ar3->Draw();
28  TArrow *ar4 = new TArrow(0.46,0.7,0.82,0.42,0.07,"|>");
29  ar4->SetAngle(60);
30  ar4->SetLineWidth(2);
31  ar4->SetFillColor(2);
32  ar4->Draw();
33  TArrow *ar5 = new TArrow(0.4,0.25,0.95,0.25,0.15,"<|>");
34  ar5->SetAngle(60);
35  ar5->SetLineWidth(4);
36  ar5->SetLineColor(4);
37  ar5->SetFillStyle(3008);
38  ar5->SetFillColor(2);
39  ar5->Draw();
40  return c1;
41 }
virtual void SetLineWidth(Width_t lwidth)
Definition: TAttLine.h:57
TCanvas * c1
Definition: legend1.C:2
virtual void SetFillStyle(Style_t fstyle)
Definition: TAttFill.h:52
TArrow * arrow
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
Definition: TArrow.cxx:121
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:32
virtual void SetLineColor(Color_t lcolor)
Definition: TAttLine.h:54
virtual void SetFillColor(Color_t fcolor)
Definition: TAttFill.h:50
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Set world coordinate system for the pad.
Definition: TPad.cxx:4623
The Canvas class.
Definition: TCanvas.h:48
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
Draw all kinds of Arrows.
Definition: TArrow.h:35
virtual void SetAngle(Float_t angle=60)
Definition: TArrow.h:64