Drawing primitives inside and outside of the frame.
In normal ROOT graphics all objects drawn on the pad and therefore requires special treatment to be able drawn only inside frame borders. In web-based graphics objects automatically clipped by frame border - if drawn inside frame. Macro demonstrates usage of "frame" draw option for TLine, TBox, TMarker and TLatex classes. If user interactively change zooming range "in-frame" objects automatically clipped.
Functionality available only in web-based graphics
{
auto c1 =
new TCanvas(
"c1",
"Drawing inside frame", 1200, 800);
if (!
gROOT->IsBatch() && !
c1->IsWeb())
::Warning(
"inframe.cxx",
"macro may not work without enabling web-based canvas");
c1->DrawFrame(0., 0., 10., 10.,
"Usage of \"frame\" draw options");
latex->SetTextSize(0.08);
auto l1 =
new TLine(-0.5, 5, 10.5, 5);
auto tl1 =
new TLatex(0.5, 5,
"line outside");
auto l2 =
new TLine(-0.5, 5.2, 10.5, 5.2);
auto tl2 =
new TLatex(0.5, 5.3,
"line inside");
auto b1 =
new TBox(-0.5, 1, 4, 3);
auto tb1 =
new TLatex(0.5, 3.1,
"box outside");
auto b2 =
new TBox(6, 1, 10.5, 3);
auto tb2 =
new TLatex(6.5, 3.1,
"box inside");
auto m1 =
new TMarker(9.5, 7., 29);
m1->SetMarkerColor(
kBlue);
m1->SetMarkerSize(3);
auto m2 =
new TMarker(9.5, 8., 34);
m2->SetMarkerSize(3);
}
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.
- Author
- Sergey Linev
Definition in file inframe.cxx.