ra4_draw  4bd0201e3d922d42bd545d4b045ed44db33454a4
styles.cpp
Go to the documentation of this file.
1 
3 #include "TStyle.h"
4 
5 #include "core/styles.hpp"
6 
7 void setPlotStyle(PlotOpt opts){
9  gStyle->SetNdivisions(opts.NDivisions(), "xyz");
10  gStyle->SetOptStat(0); // No Stats box
11  gStyle->SetPadTickX(1); // Ticks at the right
12  gStyle->SetPadTickY(1); // Ticks at the top
13  gStyle->SetCanvasDefW(opts.CanvasWidth());
14  gStyle->SetCanvasDefH(opts.CanvasHeight());
15 
17  gStyle->SetPadRightMargin (opts.RightMargin());
18  gStyle->SetPadBottomMargin(opts.BottomMargin());
19  gStyle->SetPadTopMargin (opts.TopMargin());
20  gStyle->SetPadLeftMargin (opts.LeftMargin());
21 
23  gStyle->SetTitleOffset(opts.XTitleOffset(),"x"); // Set offset of X title in histogram
24  gStyle->SetTitleOffset(opts.YTitleOffset(),"y"); // Set offset of Y title in histogram
25  gStyle->SetTextSize(opts.TitleSize()); // Set global text size
26  gStyle->SetTitleFontSize(opts.TitleSize()); // Set top title size
27  gStyle->SetTitleSize(opts.TitleSize(),"xyz"); // Set the 2 axes title size
28  gStyle->SetLabelSize(opts.LabelSize(),"xyz"); // Set the 2 axes label size
29 
30 }
PlotOpt & TopMargin(double top)
Definition: plot_opt.cpp:260
PlotOpt & LeftMargin(double left)
Definition: plot_opt.cpp:233
PlotOpt & LabelSize(double label_size)
Definition: plot_opt.cpp:156
PlotOpt & CanvasWidth(int width)
Definition: plot_opt.cpp:207
PlotOpt & CanvasHeight(int height)
Definition: plot_opt.cpp:216
PlotOpt & XTitleOffset(double x_title_offset)
Definition: plot_opt.cpp:165
PlotOpt & NDivisions(int n_divisions)
Definition: plot_opt.cpp:332
PlotOpt & TitleSize(double title_size)
Definition: plot_opt.cpp:147
PlotOpt & BottomMargin(double bottom)
Definition: plot_opt.cpp:251
PlotOpt & RightMargin(double right)
Definition: plot_opt.cpp:242
void setPlotStyle(PlotOpt opts)
Definition: styles.cpp:7
PlotOpt & YTitleOffset(double y_title_offset)
Definition: plot_opt.cpp:174