Logo ROOT   6.14/05
Reference Guide
markerStyle.cxx
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_v7
3 ///
4 /// \macro_code
5 ///
6 /// \date 2018-03-18
7 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
8 /// is welcome!
9 /// \author Iliana Betsou
10 
11 #include "ROOT/TCanvas.hxx"
12 #include "ROOT/TColor.hxx"
13 #include "ROOT/TText.hxx"
14 #include "ROOT/TMarker.hxx"
15 #include "ROOT/TPadPos.hxx"
16 
17 void markerStyle() {
18  using namespace ROOT;
19  using namespace ROOT::Experimental;
20 
21  auto canvas = Experimental::TCanvas::Create("Canvas Title");
22  double num = 0.3;
23 
24  double x = 0;
25  double dx = 1/16.0;
26  for (Int_t i=1;i<16;i++) {
27  x += dx;
28 
29  TPadPos pt1(TPadLength::Normal(x), .12_normal);
30  auto ot1 = canvas->Draw(Experimental::TText(pt1, Form("%d", i)));
31  TPadPos pm1(TPadLength::Normal(x), .25_normal);
32  auto om1 = canvas->Draw(Experimental::TMarker(pm1));
33  om1->SetMarkerStyle(i);
34  om1->SetMarkerSize(2.5);
35 
36  TPadPos pt2(TPadLength::Normal(x), .42_normal);
37  auto ot2 = canvas->Draw(Experimental::TText(pt2, Form("%d", i+19)));
38  TPadPos pm2(TPadLength::Normal(x), .55_normal);
39  auto om2 = canvas->Draw(Experimental::TMarker(pm2));
40  om2->SetMarkerStyle(i+19);
41  om2->SetMarkerSize(2.5);
42 
43  TPadPos pt3(TPadLength::Normal(x), .72_normal);
44  auto ot3 = canvas->Draw(Experimental::TText(pt3, Form("%d", i+34)));
45  TPadPos pm3(TPadLength::Normal(x), .85_normal);
46  auto om3 = canvas->Draw(Experimental::TMarker(pm3));
47  om3->SetMarkerStyle(i+34);
48  om3->SetMarkerSize(2.5);
49  }
50 
51  canvas->Show();
52 }
A normalized coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the TPad...
Definition: TPadLength.hxx:75
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
int Int_t
Definition: RtypesCore.h:41
Double_t x[n]
Definition: legend1.C:17
A position (horizontal and vertical) in a TPad.
Definition: TPadPos.hxx:27
char * Form(const char *fmt,...)
static std::shared_ptr< TCanvas > Create(const std::string &title)
Definition: TCanvas.cxx:74