TWiki
>
Computing Web
>
RootTips
(03 Oct 2008,
_47C_61UK_47O_61eScience_47OU_61Cambridge_47L_61UCS_47CN_61karl_32harrison002
?
)
(raw view)
E
dit
A
ttach
%TOC% ---++ General appearance ---+++ Set background colour To replace a grey background with white, use: <verbatim> c1->SetFillColor(10); </verbatim> where c1 is the canvas name. It's also possible to use kWhite rather than the value 10. (Neil Collins, 25 September 2008) ---++ Annotating plots ---+++ Draw line This can be done in one line using the syntax: <verbatim> (new TLine(-10, 0.4, 10, 0.4))->Draw(); </verbatim> The arguments of the TLine constructor are co-ordinates based on the histogram axes. (Chris Curtis, 25 September 2008) ---+++ Draw arrow To draw an arrow on a plot at a specific place, use the same technique as for Draw line, but use TArrow rather than TLine. All you need to do if you want the arrow in the opposite direction is to reverse the co-ordinates. (Neil Collins, 25 September 2008) ---+++ Add legend To add a legend to the plot, you need to do something like the following: <verbatim> // Create legend object and define legend size // First two arguments are the bottom left corner position // and the second two are the top right corner leg = new TLegend(0.45,0.65,0.85,0.80); // Add legend entries, giving: Histo name, label, option for marker type // For the marker type, l draws a line, p matches to the points used in the plot leg->AddEntry(Run1_TauRec_minimum_d_R_c2,"Z#rightarrow#tau#tau","l"); leg->AddEntry(Run2_TauRec_minimum_d_R_c2,"t#bar{t}","l"); // Option to set text size (and override legend size) leg->SetTextSize(0.055); // Set legend boarder type (usually defaults to being like the stats box) leg->SetBorderSize(1); // Set background colour as white leg->SetFillColor(kWhite); // Draw legend on plot leg->Draw(); </verbatim> (Neil Collins, 25 September 2008)
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r2 - 03 Oct 2008
-
_47C_61UK_47O_61eScience_47OU_61Cambridge_47L_61UCS_47CN_61karl_32harrison002
?
Computing
Log In
Computing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
ALICE
ATLAS
BILPA
CALICE
Computing
General
LHCb
LinearCollider
Main
NA62
Publish
Sandbox
TWiki
Welcome
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback