Plot¶
-
class
Plot.Plot(name=None, **kwargs)[source]¶ Bases:
MethodProxy.MethodProxyClass for creating plots.
Stores
ROOTobjects like histograms and draws them in their specifiedPadonto aCanvas.-
__init__(name=None, **kwargs)[source]¶ Initialize a plot.
Create an instance of
Plotwith the specified name.Parameters: - name (
str) – name of the plot (default: random 8-digits HEX hash value) - **kwargs –
Plotproperties
- name (
-
SetNPads(npads)[source]¶ Set the number of
Pads associated to the plot.This will also determine the size and layout of the underlying
Canvas.Parameters: npads ( int) – number of pads (default: 1)
-
Register(object, pad=0, **kwargs)[source]¶ Register a
ROOTobject to the plot.The associated
Padis defined by pad. Properties of the object and the associatedPadcan be changed via keyword arguments.Parameters: - object (
ROOT.TObject) – drawableROOTobject to be registered to the plot, e.g.Histo1D,TH1D,Histo2D,TH2D,Stack, … - pad (
int) – index of the target pad (default: 0) - **kwargs – object,
Padproperties
- object (
-
Print(path, **kwargs)[source]¶ Print the plot to a file.
Creates a
Canvasand draws all registered objects into their associatedPad. The canvas is saved as a PDF/PNG/… file with the absolute path defined by path. If a file with the same name already exists it will be overwritten (can be changed with the overwrite keyword argument). If mkdir is set toTrue(default:False) directories in path with do not yet exist will be created automatically.The properties of the of the plot and canvas can be configured via their respective properties passed as keyword arguments.
Parameters: Keyword Arguments:
- inject<N> (
list,tuple,ROOT.TObject) – inject a (list of) drawableROOTobject(s) to pad <N> (default: 0), object properties can be specified by passing instead atupleof the format(obj, props)wherepropsis adictholding the object properties (default: []) - overwrite (
bool) – overwrite an existing file located at path (default:True) - mkdir (
bool) – create non-existing directories in path (default:False)
- inject<N> (
-
Inject(pad=0, *args)[source]¶ Inject a (list of) drawable object(s) to the pad with index pad.
Object properties can be specified by passing instead a
tupleof the format(obj, props)wherepropsis adictholding the object properties.Parameters: - pad (
int) – index of the target pad (default: 0) - *args (
tuple,ROOT.TObject) – drawableROOTobject ortupleof the format(obj, props)wherepropsis adictholding the object properties
- pad (
-
SetState(state)[source]¶ Set the plot state.
Parameters: label ( str) – plot state (default: ‘Work In Progress’)
-
SetCME(cme)[source]¶ Set the value of the center-of-mass energy.
Parameters: label ( int,str) – center-of-mass energy in TeV
-