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");
29 auto latex =
new TLatex(3., 8.,
"Text in the frame");
31 latex->SetTextSize(0.08);
32 latex->SetTextAlign(22);
36 auto l1 =
new TLine(-0.5, 5, 10.5, 5);
40 auto tl1 =
new TLatex(0.5, 5,
"line outside");
42 tl1->SetTextAlign(13);
46 auto l2 =
new TLine(-0.5, 5.2, 10.5, 5.2);
50 auto tl2 =
new TLatex(0.5, 5.3,
"line inside");
52 tl2->SetTextAlign(11);
53 c1->Add(
tl2,
"frame");
56 auto b1 =
new TBox(-0.5, 1, 4, 3);
57 b1->SetFillColor(
kBlue);
60 auto tb1 =
new TLatex(0.5, 3.1,
"box outside");
62 tb1->SetTextAlign(11);
66 auto b2 =
new TBox(6, 1, 10.5, 3);
77 auto tb2 =
new TLatex(6.5, 3.1,
"box inside");
79 tb2->SetTextAlign(11);
80 c1->Add(
tb2,
"frame");
83 auto m1 =
new TMarker(9.5, 7., 29);
84 m1->SetMarkerColor(
kBlue);
88 auto tm1 =
new TLatex(9.3, 7.,
"outside");
90 tm1->SetTextAlign(32);
94 auto m2 =
new TMarker(9.5, 8., 34);
95 m2->SetMarkerColor(
kGreen);
101 tm2->SetTextAlign(32);
102 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.