21 auto c1 =
new TCanvas(
"c1",
"Drawing inside frame", 1200, 800);
23 if (!
gROOT->IsBatch() && !
c1->IsWeb())
24 ::Warning(
"inframe.cxx",
"macro may not work without enabling web-based canvas");
26 c1->DrawFrame(0., 0., 10., 10.,
"Usage of \"frame\" draw options");
28 auto latex =
new TLatex(3., 8.,
"Text in the frame");
30 latex->SetTextSize(0.08);
31 latex->SetTextAlign(22);
35 auto l1 =
new TLine(-0.5, 5, 10.5, 5);
39 auto tl1 =
new TLatex(0.5, 5,
"line outside");
41 tl1->SetTextAlign(13);
45 auto l2 =
new TLine(-0.5, 5.2, 10.5, 5.2);
49 auto tl2 =
new TLatex(0.5, 5.3,
"line inside");
51 tl2->SetTextAlign(11);
52 c1->Add(
tl2,
"frame");
55 auto b1 =
new TBox(-0.5, 1, 4, 3);
56 b1->SetFillColor(
kBlue);
59 auto tb1 =
new TLatex(0.5, 3.1,
"box outside");
61 tb1->SetTextAlign(11);
65 auto b2 =
new TBox(6, 1, 10.5, 3);
76 auto tb2 =
new TLatex(6.5, 3.1,
"box inside");
78 tb2->SetTextAlign(11);
79 c1->Add(
tb2,
"frame");
82 auto m1 =
new TMarker(9.5, 7., 29);
83 m1->SetMarkerColor(
kBlue);
87 auto tm1 =
new TLatex(9.3, 7.,
"outside");
89 tm1->SetTextAlign(32);
93 auto m2 =
new TMarker(9.5, 8., 34);
94 m2->SetMarkerColor(
kGreen);
100 tm2->SetTextAlign(32);
101 c1->Add(
tm2,
"frame");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
To draw Mathematical Formula.
Use the TLine constructor to create a simple line.