Logo ROOT   6.10/09
Reference Guide
arrow.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphics
3 /// \notebook -js
4 /// Draw arrows.
5 ///
6 /// \macro_image
7 /// \macro_code
8 ///
9 /// \author Rene Brun
10 
11 TCanvas *arrow(){
12  TCanvas *c1 = new TCanvas("c1");
13  c1->Range(0,0,1,1);
14 
15  TPaveLabel *par = new TPaveLabel(0.1,0.8,0.9,0.95,"Examples of various arrow formats");
16  par->SetFillColor(42);
17  par->Draw();
18 
19  TArrow *ar1 = new TArrow(0.1,0.1,0.1,0.7);
20  ar1->Draw();
21  TArrow *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  TArrow *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  TArrow *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  TArrow *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  return c1;
42 }
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
double par[1]
Definition: unuranDistr.cxx:38
return c1
Definition: legend1.C:41
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition: TAttFill.h:39
TArrow * arrow
virtual void Draw(Option_t *option="")
Draw this arrow with its current attributes.
Definition: TArrow.cxx:122
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:20
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
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:5085
The Canvas class.
Definition: TCanvas.h:31
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:29
virtual void SetAngle(Float_t angle=60)
Definition: TArrow.h:58