Jpp  master_rocky
the software that should make you happy
Classes | Public Member Functions | List of all members
JROOT::JStyle Class Reference

Wrapper class around ROOT TStyle. More...

#include <JStyle.hh>

Inheritance diagram for JROOT::JStyle:

Classes

struct  JParameters
 

Public Member Functions

 JStyle (const char *title, const UInt_t x, const UInt_t y, const JParameters &parameters=JParameters())
 Constructor. More...
 
void setFontSize (const Double_t factor)
 Scale font sizes. More...
 

Detailed Description

Wrapper class around ROOT TStyle.

Definition at line 22 of file JStyle.hh.

Constructor & Destructor Documentation

◆ JStyle()

JROOT::JStyle::JStyle ( const char *  title,
const UInt_t  x,
const UInt_t  y,
const JParameters parameters = JParameters() 
)
inline

Constructor.

Parameters
titletitle
xnumber of pixels in X
ynumber of pixels in Y
parametersparameters

Definition at line 102 of file JStyle.hh.

105  :
106  TStyle(title, NULL)
107  {
108  const Double_t font_size = (Double_t) y * 0.7e-4 * parameters.fontSize;
109  const Double_t title_offset = 1.5 * parameters.titleOffset;
110  const Double_t tick_length = 3.0e-5 * parameters.tickLength;
111 
112  SetPadTopMargin (parameters.topMargin);
113  SetPadBottomMargin(parameters.bottomMargin);
114  SetPadLeftMargin (parameters.leftMargin);
115  SetPadRightMargin (parameters.rightMargin);
116 
117  SetCanvasColor(0);
118  SetCanvasBorderMode(0);
119  SetCanvasBorderSize(0);
120 
121  SetPadColor(0);
122  SetPadBorderMode(0);
123  SetPadBorderSize(0);
124 
125  for (const auto option : { "X", "Y", "Z"}) {
126  SetTickLength (tick_length * (x < y ? x : y), option);
127  SetLabelSize (font_size, option);
128  SetTitleOffset(title_offset, option);
129  SetTitleSize (font_size, option);
130  }
131 
132  SetTitleX(0.05);
133  SetTitleY(0.99);
134 
135  SetStatColor(0);
136  SetStatBorderSize(1);
137  SetStatFontSize(font_size);
138  SetOptStat(111111);
139  SetOptFit(1111);
140 
141  SetPaintTextFormat("3.0f");
142  SetPalette(1);
143 
144  SetTitleFillColor(0);
145  SetTitleAlign(23);
146  SetTitleX(0.5);
147  SetTitleBorderSize(0);
148  }

Member Function Documentation

◆ setFontSize()

void JROOT::JStyle::setFontSize ( const Double_t  factor)
inline

Scale font sizes.

Parameters
factorscale factor

Definition at line 156 of file JStyle.hh.

157  {
158  for (const auto option : { "X", "Y", "Z"}) {
159  SetLabelSize(GetLabelSize(option) * factor, option);
160  SetTitleSize(GetTitleSize(option) * factor, option);
161  }
162  }

The documentation for this class was generated from the following file: