Belle II Software  release-08-01-10
ValidationPlot Class Reference
Inheritance diagram for ValidationPlot:
Collaboration diagram for ValidationPlot:

Public Member Functions

def __init__ (self, name, referenceFileName=None)
 
def hist (self, xs, weights=None, stackby=None, bins=None, lower_bound=None, upper_bound=None, outlier_z_score=None, include_exceptionals=True, allow_discrete=False, cumulation_direction=None, is_expert=True)
 
def profile (self, xs, ys, weights=None, stackby=None, bins=None, lower_bound=None, upper_bound=None, y_binary=None, y_log=None, outlier_z_score=None, include_exceptionals=True, allow_discrete=False, cumulation_direction=None, gaus_z_score=None, is_expert=True, is_asymmetry=False)
 
def scatter (self, xs, ys, stackby=None, lower_bound=(None, None), upper_bound=(None, None), outlier_z_score=(None, None), include_exceptionals=(True, True), max_n_data=100000, is_expert=True)
 
def grapherrors (self, xs_and_err, ys_and_err, stackby=None, lower_bound=(None, None), upper_bound=(None, None), outlier_z_score=(None, None), include_exceptionals=(True, True), max_n_data=100000, is_expert=True)
 
def hist2d (self, xs, ys, weights=None, stackby=None, bins=(None, None), lower_bound=(None, None), upper_bound=(None, None), outlier_z_score=(None, None), include_exceptionals=(True, True), allow_discrete=(False, False), quantiles=None, is_expert=True)
 
def fit_gaus (self, z_score=None)
 
def fit_line (self)
 
def fit_const (self)
 
def fit_diag (self)
 
def fit (self, formula, options, lower_bound=None, upper_bound=None, z_score=None)
 
def show (self)
 
def write (self, tdirectory=None)
 
def is_expert (self)
 
def title (self)
 
def title (self, title)
 
def xlabel (self)
 
def xlabel (self, xlabel)
 
def ylabel (self)
 
def ylabel (self, ylabel)
 
def contact (self)
 
def contact (self, contact)
 
def description (self)
 
def description (self, description)
 
def check (self)
 
def check (self, check)
 
def create_1d (self, th1_factory, xs, ys=None, weights=None, bins=None, stackby=None, lower_bound=None, upper_bound=None, outlier_z_score=None, include_exceptionals=True, allow_discrete=False, cumulation_direction=None)
 
def create (self, histogram_template, xs, ys=None, weights=None, stackby=None, cumulation_direction=None, reverse_stack=None)
 
def create_stack (cls, histograms, name, reverse_stack, force_graph=False)
 
def convert_tprofile_to_tgrapherrors (cls, tprofile, abs_x=False)
 
def fill_into_grouped (self, histogram_template, xs, ys=None, weights=None, groupbys=None, groupby_label="group")
 
def set_color (self, tobject, root_i_color)
 
def fill_into (self, plot, xs, ys=None, weights=None, filter=None)
 
def fill_into_tgrapherror (self, graph, xs, ys, filter=None)
 
def fill_into_tgraph (self, graph, xs, ys, filter=None)
 
def fill_into_th1 (self, histogram, xs, ys=None, weights=None, filter=None)
 
def add_nan_inf_stats (cls, histogram, name, xs)
 
def add_stats_entry (cls, histogram, label, value)
 
def get_additional_stats (cls, histogram)
 
def gaus_slice_fit (cls, th2, name, z_score=None)
 
def cumulate (cls, histogram, cumulation_direction=None)
 
def determine_bin_edges (self, xs, stackbys=None, bins=None, lower_bound=None, upper_bound=None, outlier_z_score=None, include_exceptionals=True, allow_discrete=False)
 
def determine_bin_range (self, xs, stackbys=None, n_bins=None, lower_bound=None, upper_bound=None, outlier_z_score=None, include_exceptionals=True)
 
def determine_range (self, xs, lower_bound=None, upper_bound=None, outlier_z_score=None, include_exceptionals=True)
 
def set_additional_stats_tf1 (cls, histogram)
 
def set_fit_tf1 (cls, histogram, fit_tf1)
 
def set_tf1 (cls, histogram, tf1)
 
def delete_tf1 (cls, histogram)
 
def create_additional_stats_tf1 (cls, histogram)
 
def combine_fit_and_additional_stats (cls, fit_tf1, additional_stats_tf1)
 
def copy_tf1_parameters (cls, tf1_source, tf1_target, offset=0)
 
def attach_attributes (self)
 
def set_maximum (self, maximum)
 
def set_minimum (self, minimum)
 
def set_tstyle (cls)
 

Static Public Member Functions

def unpack_2d_param (param)
 
def is_binary (xs)
 
def is_discrete (xs, max_n_unique=None)
 
def get_exceptional_values (xs)
 
def get_robust_mean_and_std (xs)
 
def format_bin_label (value)
 

Public Attributes

 name
 A unique name to be used as the name of the ROOT object to be generated.
 
 referenceFileName
 name of the reference file, if not None the binning will be read from there
 
 plot
 The main plot object, may contain one or more (in case of stacked pltos) histograms.
 
 histograms
 A list of the histograms that make up the plot.
 
 pvalue_warn
 custom levels for pvalue warnings
 
 pvalue_error
 custom levels for pvalue errors
 
 y_log
 Indicator whether the y axes should be displayed as a log scale.
 
 ylabel
 default label for the histogram's Y axis More...
 
 lower_bound
 lower left corner of the histogram
 
 upper_bound
 upper right corner of the hisogram
 
 check
 cached value of the user-check action for this plot
 
 contact
 contact information for this plot
 
 description
 description of the plot
 
 xlabel
 cached value of the x-axis label for this plot
 
 title
 cached value of the title for this plot
 

Static Public Attributes

int very_sparse_dots_line_style_index = 28
 A an index that reference to a dot spacing such that the line is almost invisible for scatter.
 

Private Attributes

 _description
 Description of the plot purpose for display on the validation page.
 
 _check
 Detailed check instructions for display on the validation page.
 
 _contact
 Contact email address for display on the validation page.
 
 _xlabel
 X axes label of the validation plot.
 
 _ylabel
 Y axes label of the validation plot.
 
 _title
 Title of the validation plot.
 
 _is_expert
 per default all plots are expert and must be set to non-expert explicitly
 

Detailed Description

Class for generating a validation plot for the Belle II validation page.

Typically it generates plots from values stored in numpy arrays and feeds them into
plot ROOT classes for storing them.

It implements an automatic binning procedure based on the rice rule and
robust z score outlier detection.

It also keeps track of additional statistics typically neglected by ROOT such as a count
for the non finit values such as NaN, +Inf, -Inf.

The special attributes for the Belle II validation page like
* title
* contract
* description
* check
are exposed as properties of this class.

Definition at line 160 of file plot.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  referenceFileName = None 
)
Constructor of the ValidationPlot

Parameters
----------
name : str
    A unique name to be used as the name of the ROOT object to be generated

referenceFileName : str
    name of a reference file. If set the code will try to get the histogram or profile
    from that file and determine the number of bins and upper and lower bound
    (so far only implemented for 1D (TH1, TProfile), is ignored for 2D plots)

Definition at line 185 of file plot.py.

185  def __init__(self, name, referenceFileName=None):
186  """Constructor of the ValidationPlot
187 
188  Parameters
189  ----------
190  name : str
191  A unique name to be used as the name of the ROOT object to be generated
192 
193  referenceFileName : str
194  name of a reference file. If set the code will try to get the histogram or profile
195  from that file and determine the number of bins and upper and lower bound
196  (so far only implemented for 1D (TH1, TProfile), is ignored for 2D plots)
197  """
198 
199 
200  self.name = root_save_name(name)
201 
202 
203  self.referenceFileName = referenceFileName
204 
205 
206  self._description = ''
207 
208 
209  self._check = ''
210 
211 
212  self._contact = ''
213 
214 
215  self._xlabel = ''
216 
217 
218  self._ylabel = ''
219 
220 
221  self._title = ''
222 
223 
224  self.plot = None
225 
226 
227  self.histograms = []
228 
229 
230  self._is_expert = True
231 
232 
233  self.pvalue_warn = None
234 
235 
236  self.pvalue_error = None
237 
238 
239  self.y_log = False
240 

Member Function Documentation

◆ add_nan_inf_stats()

def add_nan_inf_stats (   cls,
  histogram,
  name,
  xs 
)
 Extracts the counts of non finite floats from a series
and adds them as additional statistics to the histogram.

Parameters
----------
histogram : derived from ROOT.TH1 or ROOT.TGraph
    Something having a GetListOfFunctions method that
name : str
    A label for the data series to be prefixed to the entries.
xs : numpy.ndarray (1d)
    Data from which the non finit floats should be counted.

Definition at line 1443 of file plot.py.

◆ add_stats_entry()

def add_stats_entry (   cls,
  histogram,
  label,
  value 
)
Add a new additional statistics to the histogram.

Parameters
----------
histogram : derived from ROOT.TH1 or ROOT.TGraph
    Something having a GetListOfFunctions method that holds the additional statistics
label : str
    Label of the statistic
value : float
    Value of the statistic

Definition at line 1469 of file plot.py.

◆ attach_attributes()

def attach_attributes (   self)
Reassign the special attributes of the plot forwarding them to the ROOT plot.

Definition at line 2239 of file plot.py.

◆ check() [1/2]

def check (   self)
Getter for the check to be displayed on the validation page

Definition at line 877 of file plot.py.

◆ check() [2/2]

def check (   self,
  check 
)
Setter for the check to be displayed on the validation page

Definition at line 882 of file plot.py.

◆ combine_fit_and_additional_stats()

def combine_fit_and_additional_stats (   cls,
  fit_tf1,
  additional_stats_tf1 
)
Combine the fit function and the function carrying the additional statistics to one function.

Parameters
----------
fit_tf1 : ROOT.TF1
    The fit function
additional_stats_tf1 : ROOT.TF1
    The function carrying the additional statistics as parameters

Returns
-------
ROOT.TF1

Definition at line 2156 of file plot.py.

◆ contact() [1/2]

def contact (   self)
Getter for the contact email address to be displayed on the validation page

Definition at line 843 of file plot.py.

◆ contact() [2/2]

def contact (   self,
  contact 
)
Setter for the contact email address to be displayed on the validation page

Definition at line 848 of file plot.py.

◆ convert_tprofile_to_tgrapherrors()

def convert_tprofile_to_tgrapherrors (   cls,
  tprofile,
  abs_x = False 
)
Extract errors from a TProfile histogram and create a TGraph from these

Definition at line 1123 of file plot.py.

◆ copy_tf1_parameters()

def copy_tf1_parameters (   cls,
  tf1_source,
  tf1_target,
  offset = 0 
)
Copy the parameters of one TF1 to  another.

Parameters
----------
tf1_source : ROOT.TF1
    Take parameters from here
tf1_target : ROOT.TF1
    Copy them to here.
offset : int, optional
    Index of the first target parameter to which to copy.

Definition at line 2200 of file plot.py.

◆ create()

def create (   self,
  histogram_template,
  xs,
  ys = None,
  weights = None,
  stackby = None,
  cumulation_direction = None,
  reverse_stack = None 
)
Create histograms from a template, possibly stacked

Definition at line 1048 of file plot.py.

◆ create_1d()

def create_1d (   self,
  th1_factory,
  xs,
  ys = None,
  weights = None,
  bins = None,
  stackby = None,
  lower_bound = None,
  upper_bound = None,
  outlier_z_score = None,
  include_exceptionals = True,
  allow_discrete = False,
  cumulation_direction = None 
)
Combined factory method for creating a one dimensional histogram or a profile plot.

Definition at line 982 of file plot.py.

◆ create_additional_stats_tf1()

def create_additional_stats_tf1 (   cls,
  histogram 
)
Create a TF1 with the additional statistics from the histogram as parameters.

Parameters
----------
histogram : ROOT.TH1 or ROOT.TGraph
    Something having a GetListOfFunctions method that holds the additional statistics.

Returns
-------
ROOT.TF1
    Function with the additional statistics as parameters.

Definition at line 2115 of file plot.py.

◆ create_stack()

def create_stack (   cls,
  histograms,
  name,
  reverse_stack,
  force_graph = False 
)
Create a stack of histograms

Definition at line 1091 of file plot.py.

◆ cumulate()

def cumulate (   cls,
  histogram,
  cumulation_direction = None 
)
Cumulates the histogram inplace.

Parameters
----------
histogram : ROOT.TH1 or ROOT.TProfile
    Filled histogram to be cumulated
cumulation_direction : int, optional
    Direction is indicated by the sign.
    Positive means from left to right, negative means from right to left.
    If now cumulation direction is given return the histogram as is.

Returns
-------
ROOT.TH1
    Cumulated histogram potentially altered inplace.

Definition at line 1575 of file plot.py.

◆ delete_tf1()

def delete_tf1 (   cls,
  histogram 
)
Delete the attached TF1 from the histogram

Parameters
----------
histogram : ROOT.TH1 or ROOT.TGraph
    Something having a GetListOfFunctions method that holds the fit function

Definition at line 2101 of file plot.py.

◆ description() [1/2]

def description (   self)
Getter for the description to be displayed on the validation page

Definition at line 860 of file plot.py.

◆ description() [2/2]

def description (   self,
  description 
)
Setter for the description to be displayed on the validation page

Definition at line 865 of file plot.py.

◆ determine_bin_edges()

def determine_bin_edges (   self,
  xs,
  stackbys = None,
  bins = None,
  lower_bound = None,
  upper_bound = None,
  outlier_z_score = None,
  include_exceptionals = True,
  allow_discrete = False 
)
Deducing bin edges from a data series.

Parameters
----------
xs : numpy.ndarray (1d)
    Data point for which a binning should be found.
stackbys : numpy.ndarray (1d)
    Categories of the data points to be distinguishable
bins : list(float) or int or None, optional
    Preset bin edges or preset number of desired bins.
    The default, None, means the bound should be extracted from data.
    The rice rule is used the determine the number of bins.
    If a list of floats is given return them immediatly.
lower_bound : float or None, optional
    Preset lower bound of the binning range.
    The default, None, means the bound should be extracted from data.
upper_bound : float or None, optional
    Preset upper bound of the binning range.
    The default, None, means the bound should be extracted from data.
outlier_z_score : float or None, optional
    Threshold z-score of outlier detection.
    The default, None, means no outlier detection.
include_exceptionals : bool, optional
    If the outlier detection is active this switch indicates,
    if values detected as exceptionally frequent shall be included
    nevertheless into the binning range. Default is True,
    which means exceptionally frequent values as included
    even if they are detected as outliers.

Returns
-------
np.array (1d), list(str)
    Pair of bin edges and labels deduced from the series.
    Second element is None if the series is not detected as discrete.

Definition at line 1673 of file plot.py.

◆ determine_bin_range()

def determine_bin_range (   self,
  xs,
  stackbys = None,
  n_bins = None,
  lower_bound = None,
  upper_bound = None,
  outlier_z_score = None,
  include_exceptionals = True 
)
Calculates the number of bins, the lower bound and the upper bound from a given data series
estimating the values that are not given.

If the outlier_z_score is given the method tries to exclude outliers that exceed a certain z-score.
The z-score is calculated (x - x_mean) / x_std. The be robust against outliers the necessary
mean and std deviation are based on truncated mean and a trimmed std calculated from the inter
quantile range (IQR).

If additional include_exceptionals is true the method tries to find exceptional values in the series
and always include them in the range if it finds any.
Exceptional values means exact values that appear often in the series for whatever reason.
Possible reasons include
* Interal / default values
* Failed evaluation conditions
* etc.
which should be not cropped away automatically if you are locking on the quality of your data.

Parameters
----------
xs : numpy.ndarray (1d)
    Data point for which a binning should be found.
stackbys : numpy.ndarray (1d)
    Categories of the data points to be distinguishable
n_bins : int or None, optional
    Preset number of desired bins. The default, None, means the bound should be extracted from data.
    The rice rule is used the determine the number of bins.
lower_bound : float or None, optional
    Preset lower bound of the binning range.
    The default, None, means the bound should be extracted from data.
upper_bound : float or None, optional
    Preset upper bound of the binning range.
    The default, None, means the bound should be extracted from data.
outlier_z_score : float or None, optional
    Threshold z-score of outlier detection.
    The default, None, means no outlier detection.
include_exceptionals : bool, optional
    If the outlier detection is active this switch indicates,
    if values detected as exceptionally frequent shall be included
    nevertheless into the binning range. Default is True,
    which means exceptionally frequent values as included
    even if they are detected as outliers.

Returns
-------
n_bins, lower_bound, upper_bound : int, float, float
    A triple of found number of bins, lower bound and upper bound of the binning range.

Definition at line 1833 of file plot.py.

◆ determine_range()

def determine_range (   self,
  xs,
  lower_bound = None,
  upper_bound = None,
  outlier_z_score = None,
  include_exceptionals = True 
)
Parameters
----------
xs : numpy.ndarray (1d)
    Data point for which a binning should be found.
lower_bound : float or None, optional
    Preset lower bound of the binning range.
    The default, None, means the bound should be extracted from data.
upper_bound : float or None, optional
    Preset upper bound of the binning range.
    The default, None, means the bound should be extracted from data.
outlier_z_score : float or None, optional
    Threshold z-score of outlier detection.
    The default, None, means no outlier detection.
include_exceptionals : bool, optional
    If the outlier detection is active this switch indicates,
    if values detected as exceptionally frequent shall be included
    nevertheless into the binning range. Default is True,
    which means exceptionally frequent values as included
    even if they are detected as outliers.

Returns
-------
lower_bound, upper_bound : float, float
    A pair of found lower bound and upper bound of series.

Definition at line 1933 of file plot.py.

◆ fill_into()

def fill_into (   self,
  plot,
  xs,
  ys = None,
  weights = None,
  filter = None 
)
Fill the data into the plot object

Definition at line 1251 of file plot.py.

◆ fill_into_grouped()

def fill_into_grouped (   self,
  histogram_template,
  xs,
  ys = None,
  weights = None,
  groupbys = None,
  groupby_label = "group" 
)
Fill data into similar histograms in groups indicated by a groupby array

Definition at line 1194 of file plot.py.

◆ fill_into_tgraph()

def fill_into_tgraph (   self,
  graph,
  xs,
  ys,
  filter = None 
)
Fill the data into a TGraph

Definition at line 1276 of file plot.py.

◆ fill_into_tgrapherror()

def fill_into_tgrapherror (   self,
  graph,
  xs,
  ys,
  filter = None 
)
fill point values and error of the x and y axis into the graph

Definition at line 1265 of file plot.py.

◆ fill_into_th1()

def fill_into_th1 (   self,
  histogram,
  xs,
  ys = None,
  weights = None,
  filter = None 
)
Fill the histogram blocking non finite values

Parameters
----------
histogram : ROOT.TH1
    The histogram to be filled
xs : numpy.ndarray (1d)
    Data for the first axes
ys : numpy.ndarray (1d), optional
    Data for the second axes
weights : numpy.ndarray (1d), optional
    Weight of the individual points. Defaults to one for each
filter : numpy.ndarray, optional
    Boolean index array indicating which entries shall be taken.

Definition at line 1360 of file plot.py.

◆ fit()

def fit (   self,
  formula,
  options,
  lower_bound = None,
  upper_bound = None,
  z_score = None 
)
Fit a user defined function to a one dimensional histogram

Parameters
----------
formula : str or TF1
    Formula string or TH1 to be fitted. See TF1 constructurs for that is a valid formula
options : str
   Options string to be used in the fit. See TH1::Fit()
lower_bound : float
   Lower bound of the range to be fitted
upper_bound : float
   Upper bound of the range to be fitted

Definition at line 685 of file plot.py.

◆ fit_const()

def fit_const (   self)
Fit a constant function to a one dimensional histogram

Definition at line 667 of file plot.py.

◆ fit_diag()

def fit_diag (   self)
Fit a diagonal line through the origin to a one dimensional histogram

Definition at line 676 of file plot.py.

◆ fit_gaus()

def fit_gaus (   self,
  z_score = None 
)
Fit a gaus belle curve to the central portion of a one dimensional histogram

The fit is applied to the central mean +- z_score * std interval of the histogram,
such that it is less influence by non gaussian tails further away than the given z score.

@param float z_score   number of sigmas to include from the mean value of the histogram.

Definition at line 618 of file plot.py.

◆ fit_line()

def fit_line (   self)
Fit a general line to a one dimensional histogram

Definition at line 657 of file plot.py.

◆ format_bin_label()

def format_bin_label (   value)
static
Formats a value to be placed at a tick on an axis.

Definition at line 970 of file plot.py.

◆ gaus_slice_fit()

def gaus_slice_fit (   cls,
  th2,
  name,
  z_score = None 
)
Extract a slice of a scatterplot and apply a Gaussian fit to it

Definition at line 1509 of file plot.py.

◆ get_additional_stats()

def get_additional_stats (   cls,
  histogram 
)
Get the additional statistics from the histogram and return them a dict.

Parameters
----------
histogram : derived from ROOT.TH1 or ROOT.TGraph
    Something having a GetListOfFunctions method that holds the additional statistics

Returns
-------
collection.OrderedDict
    A map of labels to values for the additional statistics

Definition at line 1486 of file plot.py.

◆ get_exceptional_values()

def get_exceptional_values (   xs)
static
Find exceptionally frequent values

Parameters
----------
xs : np.array (1d)
    Data series

Returns
-------
np.array (1d)
    A list of the found exceptional values.

Definition at line 936 of file plot.py.

◆ get_robust_mean_and_std()

def get_robust_mean_and_std (   xs)
static
Does an estimation of mean and standard deviation robust against outliers.

Parameters
----------
xs : np.array (1d)
    Data series

Returns
-------
float, float
   Pair of mean and standard deviation

Definition at line 952 of file plot.py.

◆ grapherrors()

def grapherrors (   self,
  xs_and_err,
  ys_and_err,
  stackby = None,
  lower_bound = (None, None),
  upper_bound = (None, None),
  outlier_z_score = (None, None),
  include_exceptionals = (True, True),
  max_n_data = 100000,
  is_expert = True 
)
Fill the plot with a (unbinned) two dimensional scatter plot
xs_and_err and ys_and_err are tuples containing the values and the errors on these values
as numpy arrays

Definition at line 429 of file plot.py.

◆ hist()

def hist (   self,
  xs,
  weights = None,
  stackby = None,
  bins = None,
  lower_bound = None,
  upper_bound = None,
  outlier_z_score = None,
  include_exceptionals = True,
  allow_discrete = False,
  cumulation_direction = None,
  is_expert = True 
)
Fill the plot with a one dimensional histogram.

Definition at line 241 of file plot.py.

◆ hist2d()

def hist2d (   self,
  xs,
  ys,
  weights = None,
  stackby = None,
  bins = (None, None),
  lower_bound = (None, None),
  upper_bound = (None, None),
  outlier_z_score = (None, None),
  include_exceptionals = (True, True),
  allow_discrete = (False, False),
  quantiles = None,
  is_expert = True 
)
Fill the plot with a two dimensional histogram

Definition at line 490 of file plot.py.

◆ is_binary()

def is_binary (   xs)
static
Determine if the data consists of boolean values

Definition at line 926 of file plot.py.

◆ is_discrete()

def is_discrete (   xs,
  max_n_unique = None 
)
static
Determine if the data consists of discrete values

Definition at line 931 of file plot.py.

◆ is_expert()

def is_expert (   self)
Getter method if an plot plot is marked as expert plot

Definition at line 800 of file plot.py.

◆ profile()

def profile (   self,
  xs,
  ys,
  weights = None,
  stackby = None,
  bins = None,
  lower_bound = None,
  upper_bound = None,
  y_binary = None,
  y_log = None,
  outlier_z_score = None,
  include_exceptionals = True,
  allow_discrete = False,
  cumulation_direction = None,
  gaus_z_score = None,
  is_expert = True,
  is_asymmetry = False 
)
Fill the plot with a one dimensional profile of one variable over another.

Definition at line 284 of file plot.py.

◆ scatter()

def scatter (   self,
  xs,
  ys,
  stackby = None,
  lower_bound = (None, None),
  upper_bound = (None, None),
  outlier_z_score = (None, None),
  include_exceptionals = (True, True),
  max_n_data = 100000,
  is_expert = True 
)
Fill the plot with a (unbinned) two dimensional scatter plot

Definition at line 370 of file plot.py.

◆ set_additional_stats_tf1()

def set_additional_stats_tf1 (   cls,
  histogram 
)
Combining fit TF1 with the additional statistics and attach them to the histogram.

Parameters
----------
histogram : ROOT.TH1 or ROOT.TGraph or ROOT.TMultiGraph
    Something having a GetListOfFunctions method that should hold
    the combined fit and additional statistics function.

Definition at line 2058 of file plot.py.

◆ set_color()

def set_color (   self,
  tobject,
  root_i_color 
)
Set the color of the ROOT object.

By default the line color of a TGraph should be invisible, so do not change it
For other objects set the marker and the line color

Parameters
----------
tobject : Plotable object inheriting from TAttLine and TAttMarker such as TGraph or TH1
    Object of which the color should be set.
root_i_color : int
    Color index of the ROOT color table

Definition at line 1232 of file plot.py.

◆ set_fit_tf1()

def set_fit_tf1 (   cls,
  histogram,
  fit_tf1 
)
Combining fit TF1 with the additional statistics and attach them to the histogram.

Parameters
----------
histogram : ROOT.TH1 or ROOT.TGraph or ROOT.TMultiGraph
    Something having a GetListOfFunctions method that should hold
    the combined fit and additional statistics function.

Definition at line 2071 of file plot.py.

◆ set_maximum()

def set_maximum (   self,
  maximum 
)
Sets the maximum of the vertical plotable range

Definition at line 2256 of file plot.py.

◆ set_minimum()

def set_minimum (   self,
  minimum 
)
Sets the minimum of the vertical plotable range

Definition at line 2264 of file plot.py.

◆ set_tf1()

def set_tf1 (   cls,
  histogram,
  tf1 
)
Set the attached TF1 of the histogram.

Parameters
----------
histogram : ROOT.TH1 or ROOT.TGraph or ROOT.TMultiGraph
    Something having a GetListOfFunctions method that should hold
    the combined fit and additional statistics function.

Definition at line 2085 of file plot.py.

◆ set_tstyle()

def set_tstyle (   cls)
Set the style such that the additional stats entries are shown by the TBrowser

Definition at line 2273 of file plot.py.

◆ show()

def show (   self)
Show the plot.

Definition at line 750 of file plot.py.

◆ title() [1/2]

def title (   self)
Getter for the plot title

Definition at line 805 of file plot.py.

◆ title() [2/2]

def title (   self,
  title 
)
Setter for the plot title

Definition at line 810 of file plot.py.

◆ unpack_2d_param()

def unpack_2d_param (   param)
static
Unpacks a function parameter for the two dimensional plots.

If it is a pair the first parameter shall apply to the x coordinate
the second to the y coordinate. In this case the pair is returned as two values

If something else is given the it is assumed that this parameter should equally apply
to both coordinates. In this case the same values is return twice as a pair.

Parameters
----------
param : pair or single value
    Function parameter for a two dimensional plot

Returns
-------
pair
    A pair of values being the parameter for the x coordinate and
    the y coordinate respectively

Definition at line 897 of file plot.py.

◆ write()

def write (   self,
  tdirectory = None 
)
Write the plot to file

Parameters
----------
tdirectory : ROOT.TDirectory, optional
    ROOT directory to which the plot should be written.
    If omitted write to the current directory

Definition at line 757 of file plot.py.

◆ xlabel() [1/2]

def xlabel (   self)
Getter for the axis label at the x axis

Definition at line 819 of file plot.py.

◆ xlabel() [2/2]

def xlabel (   self,
  xlabel 
)
Setter for the axis label at the x axis

Definition at line 824 of file plot.py.

◆ ylabel() [1/2]

def ylabel (   self)
Getter for the axis label at the y axis

Definition at line 831 of file plot.py.

◆ ylabel() [2/2]

def ylabel (   self,
  ylabel 
)
Setter for the axis label at the y axis

Definition at line 836 of file plot.py.

Member Data Documentation

◆ ylabel

ylabel

default label for the histogram's Y axis

cached value of the y-axis label for this plot

Definition at line 280 of file plot.py.


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