Difference: TimothyBrooks (21 vs. 22)

Revision 2207 Jun 2010 - TimothyBrooks

Line: 1 to 1
 
META TOPICPARENT name="TWikiUsers"

My Links

Line: 91 to 91
  This switches off the toner wasting gray backgrounds on plots and the bizarre yellow borders.
Added:
>
>

Adding Legends to Plots

leg = new TLegend(0.6,0.7,0.89,0.89);
leg->AddEntry(hist_A, "Sample A","f");
leg->AddEntry(hist_B, "Sample B","f");
leg->SetFillStyle(0)
leg->Draw("same") 
AddEntry takes the histogram handle, a title for that histogram, and an option that is either "f" for boxes or "l" for lines.
SetFillStyle(0) makes the legends background transparent and adds a border. Alternatively, you can SetFillColor(kWhite) for a white background with no border. (Make sure you don't lose and datapoints behind it!)
 

ATLAS Software Links

ATLAS software information in the wiki:
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback