A "prettified" generic figure canvas. More...
#include <include/CepGenRoot/ROOTCanvas.h>
Public Member Functions | |
ROOTCanvas (const std::string &name, const std::string &title="", bool ratio=false) | |
Build a canvas from its name, title, and attributes. | |
void | SetSize (double size=600) |
Set horizontal canvas width. | |
void | Prettify (TH1 *obj) const |
Draw main plot attributes in a pretty manner. | |
void | Prettify (const THStack *stack) |
void | Prettify (TMultiGraph *mg) |
std::vector< TH1 * > | RatioPlot (TH1 *denominator, const std::vector< TH1 * > &numerators, double x_min=-999., double x_max=-999., double y_min=-999., double y_max=-999., Option_t *draw_style="hist") |
std::vector< TGraphErrors * > | RatioPlot (const TGraphErrors *denominator, const std::vector< TGraphErrors * > &numerators, double x_min=-999., double x_max=-999., double y_min=-999., double y_max=-999.) |
void | SetTopLabel (const std::string &lab) |
Specify the text to show on top of the canvas. | |
void | SetGrid (int x=1, int y=1) override |
void | SetLogx (int log=1) override |
void | SetLogy (int log=1) override |
void | SetLogz (int log=1) override |
void | SetLegendMode (const std::string &mode) |
Set the placement strategy for the legend. | |
void | SetLegendX1 (double x) |
Set the horizontal coordinate of the low-left part of the legend object. | |
void | SetLegendY1 (double y) |
Set the vertical coordinate of the low-left part of the legend object. | |
void | AddLegendEntry (const TObject *obj, const std::string &title, Option_t *option="lpf") |
Add one new entry to the legend object. | |
void | Save (const std::string &ext, const std::string &out_dir=".") |
Save the canvas in an external file. | |
TLegend * | GetLegend () const |
Retrieve the legend object (if produced) | |
void | Place (TLegend *leg, const Option_t *mode="lt") |
template<typename T , typename... Args> | |
T * | Make (Args &&... args) |
Garbage collector-like TObjects producer. | |
Static Public Attributes | |
static const std::vector< int > | colours |
Definition at line 89 of file ROOTCanvas.h.
|
explicit |
[in] | name | Canvas name (and subsequently filename on save) |
[in] | title | Upper title to display on the canvas |
[in] | ratio | Divide the canvas into a main and ratio plots sub-parts? |
Definition at line 97 of file ROOTCanvas.h.
void AddLegendEntry | ( | const TObject * | obj, |
const std::string & | title, | ||
Option_t * | option = "lpf" ) |
Definition at line 417 of file ROOTCanvas.h.
TLegend * GetLegend | ( | ) | const |
Definition at line 460 of file ROOTCanvas.h.
T * Make | ( | Args &&... | args | ) |
Definition at line 484 of file ROOTCanvas.h.
void Place | ( | TLegend * | leg, |
const Option_t * | mode = "lt" ) |
Definition at line 461 of file ROOTCanvas.h.
void Prettify | ( | const THStack * | stack | ) |
Definition at line 192 of file ROOTCanvas.h.
void Prettify | ( | TH1 * | obj | ) | const |
Definition at line 110 of file ROOTCanvas.h.
void Prettify | ( | TMultiGraph * | mg | ) |
Definition at line 208 of file ROOTCanvas.h.
std::vector< TGraphErrors * > RatioPlot | ( | const TGraphErrors * | denominator, |
const std::vector< TGraphErrors * > & | numerators, | ||
double | x_min = -999., | ||
double | x_max = -999., | ||
double | y_min = -999., | ||
double | y_max = -999. ) |
Definition at line 296 of file ROOTCanvas.h.
std::vector< TH1 * > RatioPlot | ( | TH1 * | denominator, |
const std::vector< TH1 * > & | numerators, | ||
double | x_min = -999., | ||
double | x_max = -999., | ||
double | y_min = -999., | ||
double | y_max = -999., | ||
Option_t * | draw_style = "hist" ) |
Definition at line 245 of file ROOTCanvas.h.
void Save | ( | const std::string & | ext, |
const std::string & | out_dir = "." ) |
Definition at line 431 of file ROOTCanvas.h.
|
override |
Definition at line 374 of file ROOTCanvas.h.
void SetLegendMode | ( | const std::string & | mode | ) |
Definition at line 401 of file ROOTCanvas.h.
void SetLegendX1 | ( | double | x | ) |
Definition at line 404 of file ROOTCanvas.h.
void SetLegendY1 | ( | double | y | ) |
Definition at line 411 of file ROOTCanvas.h.
|
override |
Definition at line 380 of file ROOTCanvas.h.
|
override |
Definition at line 387 of file ROOTCanvas.h.
|
override |
Definition at line 393 of file ROOTCanvas.h.
void SetSize | ( | double | size = 600 | ) |
Definition at line 107 of file ROOTCanvas.h.
void SetTopLabel | ( | const std::string & | lab | ) |
Definition at line 362 of file ROOTCanvas.h.
|
static |
Definition at line 91 of file ROOTCanvas.h.