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

Public Member Functions

def __init__ (self, figure=None, axis=None, normed_to_all_entries=False, normed_to_bin_width=False, keep_first_binning=False, range_in_std=None)
 
def add (self, data, column, mask=None, weight_column=None, label=None)
 
def finish (self)
 
def add_subplot (self, gridspecs)
 
def save (self, filename)
 
def set_plot_options (self, plot_kwargs={ 'linestyle':''})
 
def set_errorbar_options (self, errorbar_kwargs={ 'fmt':'.', 'elinewidth':3, 'alpha':1})
 Overrides default errorbar options for datapoint errorbars. More...
 
def set_errorband_options (self, errorband_kwargs={ 'alpha':0.5})
 
def set_fill_options (self, fill_kwargs=None)
 
def add (self, *args, **kwargs)
 
def finish (self, *args, **kwargs)
 
def scale_limits (self)
 

Public Attributes

 normed_to_all_entries
 Normalize histograms before drawing them.
 
 normed_to_bin_width
 Normalize histograms before drawing them.
 
 range_in_std
 Show only a certain range in terms of standard deviations of the data.
 
 ymin
 size in x/y
 
 ymax
 size in x/y
 
 xmin
 size in x/y
 
 xmax
 size in x/y
 
 keep_first_binning
 Keep first binning if user wants so.
 
 first_binning
 first binning
 
 x_axis_label
 x axis label
 
 yscale
 y limit scale
 
 xscale
 x limit scale
 
 plot_kwargs
 Default keyword arguments for plot function.
 
 errorbar_kwargs
 Default keyword arguments for errorbar function.
 
 errorband_kwargs
 Default keyword arguments for errorband function.
 
 fill_kwargs
 Default keyword arguments for fill_between function.
 

Static Public Attributes

 plots = None
 Plots added to the axis so far.
 
 labels = None
 Labels of the plots added so far.
 
float yscale = 0.0
 limit scale
 
float xscale = 0.0
 limit scale
 
 figure = None
 figure which is used to draw
 
 axis = None
 Main axis which is used to draw.
 

Private Member Functions

def _plot_datapoints (self, axis, x, y, xerr=None, yerr=None)
 

Detailed Description

Plots distribution of a quantity

Definition at line 570 of file plotting.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  figure = None,
  axis = None,
  normed_to_all_entries = False,
  normed_to_bin_width = False,
  keep_first_binning = False,
  range_in_std = None 
)
Creates a new figure and axis if None is given, sets the default plot parameters
@param figure default draw figure which is used
@param axis default draw axis which is used
@param normed true if histograms should be normed before drawing
@param keep_first_binning use the binning of the first distribution for further plots
@param range_in_std show only the data in a windows around +- range_in_std * standard_deviation around the mean

Definition at line 575 of file plotting.py.

Member Function Documentation

◆ _plot_datapoints()

def _plot_datapoints (   self,
  axis,
  x,
  y,
  xerr = None,
  yerr = None 
)
privateinherited
Plot the given datapoints, with plot, errorbar and make a errorband with fill_between
@param x coordinates of the data points
@param y coordinates of the data points
@param xerr symmetric error on x data points
@param yerr symmetric error on y data points

Definition at line 173 of file plotting.py.

◆ add() [1/2]

def add (   self,
args,
**  kwargs 
)
inherited
Add a new plot to this plotter

Definition at line 241 of file plotting.py.

◆ add() [2/2]

def add (   self,
  data,
  column,
  mask = None,
  weight_column = None,
  label = None 
)
Add a new distribution to the plots
@param data pandas.DataFrame containing all data
@param column which is used to calculate distribution histogram
@param mask boolean numpy.array defining which events are used for the histogram
@param weight_column column in data containing the weights for each event

Definition at line 608 of file plotting.py.

◆ add_subplot()

def add_subplot (   self,
  gridspecs 
)
inherited
Adds a new subplot to the figure, updates all other axes
according to the given gridspec
@param gridspecs gridspecs for all axes including the new one

Definition at line 118 of file plotting.py.

◆ finish() [1/2]

def finish (   self)
Sets limits, title, axis-labels and legend of the plot

Definition at line 655 of file plotting.py.

◆ finish() [2/2]

def finish (   self,
args,
**  kwargs 
)
inherited
Finish plotting and set labels, legends and stuff

Definition at line 247 of file plotting.py.

◆ save()

def save (   self,
  filename 
)
inherited
Save the figure into a file
@param filename of the file

Definition at line 130 of file plotting.py.

◆ scale_limits()

def scale_limits (   self)
inherited
Scale limits to increase distance to boundaries

Definition at line 253 of file plotting.py.

◆ set_errorband_options()

def set_errorband_options (   self,
  errorband_kwargs = {'alpha': 0.5} 
)
inherited
Overrides default errorband options for datapoint errorband
@param errorbar_kwargs keyword arguments for the fill_between function

Definition at line 157 of file plotting.py.

◆ set_errorbar_options()

def set_errorbar_options (   self,
  errorbar_kwargs = {'fmt': '.', 'elinewidth': 3, 'alpha': 1} 
)
inherited

Overrides default errorbar options for datapoint errorbars.

Overrides default errorbar options for datapoint errorbars
@param errorbar_kwargs keyword arguments for the errorbar function

Definition at line 149 of file plotting.py.

◆ set_fill_options()

def set_fill_options (   self,
  fill_kwargs = None 
)
inherited
Overrides default fill_between options for datapoint errorband
@param fill_kwargs keyword arguments for the fill_between function

Definition at line 165 of file plotting.py.

◆ set_plot_options()

def set_plot_options (   self,
  plot_kwargs = {'linestyle': ''} 
)
inherited
Overrides default plot options for datapoint plot
@param plot_kwargs keyword arguments for the plot function

Definition at line 141 of file plotting.py.


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