CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
python.rootplot.root2matplotlib.HistStack Class Reference
Inheritance diagram for python.rootplot.root2matplotlib.HistStack:
python.rootplot.utilities.HistStack

Public Member Functions

def __init__ (self, args, kwargs)
 
def bar (self, kwargs)
 
def bar3d (self, kwargs)
 
def barcluster (self, width=0.8, kwargs)
 
def barh (self, width=0.8, kwargs)
 
def barstack (self, kwargs)
 
def errorbar (self, offset=False, kwargs)
 
def errorbarh (self, kwargs)
 
def hist (self, label_rotation=0, kwargs)
 
def histstack (self, kwargs)
 
def show_titles (self, kwargs)
 
- Public Member Functions inherited from python.rootplot.utilities.HistStack
def __getitem__ (self, index)
 
def __init__ (self, hists=None, title=None, xlabel=None, ylabel=None)
 
def __iter__ (self)
 
def __len__ (self)
 
def __setitem__ (self, index, value)
 
def add (self, hist, kwargs)
 
def max (self)
 
def min (self, threshold=None)
 
def scale (self, factor)
 
def stackmax (self)
 

Public Attributes

 replacements
 
- Public Attributes inherited from python.rootplot.utilities.HistStack
 hists
 
 kwargs
 
 title
 
 xlabel
 
 ylabel
 

Detailed Description

A container to hold Hist objects for plotting together.

When plotting, the title and the x and y labels of the last Hist added
will be used unless specified otherwise in the constructor.

Definition at line 228 of file root2matplotlib.py.

Constructor & Destructor Documentation

def python.rootplot.root2matplotlib.HistStack.__init__ (   self,
  args,
  kwargs 
)

Definition at line 235 of file root2matplotlib.py.

235  def __init__(self, *args, **kwargs):
236  if 'replacements' in kwargs:
237  self.replacements = kwargs.pop('replacements')
238  utilities.HistStack.__init__(self, *args, **kwargs)

Member Function Documentation

def python.rootplot.root2matplotlib.HistStack.bar (   self,
  kwargs 
)
Make a bar plot, with all Hists in the stack overlaid.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.bar`.  You will probably want to set a 
transparency value (i.e. *alpha* = 0.5).

Definition at line 369 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

369  def bar(self, **kwargs):
370  """
371  Make a bar plot, with all Hists in the stack overlaid.
372 
373  Any additional keyword arguments will be passed to
374  :func:`matplotlib.pyplot.bar`. You will probably want to set a
375  transparency value (i.e. *alpha* = 0.5).
376  """
377  plots = []
378  for i, hist in enumerate(self.hists):
379  if self.title is not None: hist.title = self.title
380  if self.xlabel is not None: hist.xlabel = self.xlabel
381  if self.ylabel is not None: hist.ylabel = self.ylabel
382  all_kwargs = copy.copy(kwargs)
383  all_kwargs.update(self.kwargs[i])
384  bar = hist.bar(**all_kwargs)
385  plots.append(bar)
386  return plots
def python.rootplot.root2matplotlib.HistStack.bar3d (   self,
  kwargs 
)

Definition at line 264 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, list(), classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

264  def bar3d(self, **kwargs):
265  #### Not yet ready for primetime
266  from mpl_toolkits.mplot3d import Axes3D
267  fig = plt.figure()
268  ax = Axes3D(fig)
269  plots = []
270  labels = []
271  for i, hist in enumerate(self.hists):
272  if self.title is not None: hist.title = self.title
273  if self.xlabel is not None: hist.xlabel = self.xlabel
274  if self.ylabel is not None: hist.ylabel = self.ylabel
275  labels.append(hist.label)
276  all_kwargs = copy.copy(kwargs)
277  all_kwargs.update(self.kwargs[i])
278  bar = ax.bar(hist.x, hist.y, zs=i, zdir='y', width=hist.width,
279  **all_kwargs)
280  plots.append(bar)
281  from matplotlib.ticker import FixedLocator
282  locator = FixedLocator(list(range(len(labels))))
283  ax.w_yaxis.set_major_locator(locator)
284  ax.w_yaxis.set_ticklabels(labels)
285  ax.set_ylim3d(-1, len(labels))
286  return plots
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def python.rootplot.root2matplotlib.HistStack.barcluster (   self,
  width = 0.8,
  kwargs 
)
Make a clustered bar plot.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.bar`.

Definition at line 331 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

331  def barcluster(self, width=0.8, **kwargs):
332  """
333  Make a clustered bar plot.
334 
335  Any additional keyword arguments will be passed to
336  :func:`matplotlib.pyplot.bar`.
337  """
338  plots = []
339  spacer = (1. - width) / 2
340  width = width / len(self.hists)
341  for i, hist in enumerate(self.hists):
342  if self.title is not None: hist.title = self.title
343  if self.xlabel is not None: hist.xlabel = self.xlabel
344  if self.ylabel is not None: hist.ylabel = self.ylabel
345  all_kwargs = copy.copy(kwargs)
346  all_kwargs.update(self.kwargs[i])
347  bar = hist.bar(xoffset=width*i + spacer, width=width, **all_kwargs)
348  plots.append(bar)
349  return plots
def barcluster(self, width=0.8, kwargs)
def python.rootplot.root2matplotlib.HistStack.barh (   self,
  width = 0.8,
  kwargs 
)
Make a horizontal clustered matplotlib bar plot.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.bar`.

Definition at line 350 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

350  def barh(self, width=0.8, **kwargs):
351  """
352  Make a horizontal clustered matplotlib bar plot.
353 
354  Any additional keyword arguments will be passed to
355  :func:`matplotlib.pyplot.bar`.
356  """
357  plots = []
358  spacer = (1. - width) / 2
359  width = width / len(self.hists)
360  for i, hist in enumerate(self.hists):
361  if self.title is not None: hist.title = self.title
362  if self.xlabel is not None: hist.ylabel = self.xlabel
363  if self.ylabel is not None: hist.xlabel = self.ylabel
364  all_kwargs = copy.copy(kwargs)
365  all_kwargs.update(self.kwargs[i])
366  bar = hist.barh(yoffset=width*i + spacer, width=width, **all_kwargs)
367  plots.append(bar)
368  return plots
def python.rootplot.root2matplotlib.HistStack.barstack (   self,
  kwargs 
)
Make a matplotlib bar plot, with each Hist stacked upon the last.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.bar`.

Definition at line 287 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, rpcdqm::utils.ylabel, and ComparisonHelper.zip().

287  def barstack(self, **kwargs):
288  """
289  Make a matplotlib bar plot, with each Hist stacked upon the last.
290 
291  Any additional keyword arguments will be passed to
292  :func:`matplotlib.pyplot.bar`.
293  """
294  bottom = None # if this is set to zeroes, it fails for log y
295  plots = []
296  for i, hist in enumerate(self.hists):
297  if self.title is not None: hist.title = self.title
298  if self.xlabel is not None: hist.xlabel = self.xlabel
299  if self.ylabel is not None: hist.ylabel = self.ylabel
300  all_kwargs = copy.copy(kwargs)
301  all_kwargs.update(self.kwargs[i])
302  bar = hist.bar(bottom=bottom, **all_kwargs)
303  plots.append(bar)
304  if not bottom: bottom = [0. for i in range(self.hists[0].nbins)]
305  bottom = [sum(pair) for pair in zip(bottom, hist.y)]
306  return plots
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def python.rootplot.root2matplotlib.HistStack.errorbar (   self,
  offset = False,
  kwargs 
)
Make a matplotlib errorbar plot, with all Hists in the stack overlaid.

Passing 'offset=True' will slightly offset each dataset so overlapping
errorbars are still visible.  Any additional keyword arguments will
be passed to :func:`matplotlib.pyplot.errorbar`.

Definition at line 387 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

387  def errorbar(self, offset=False, **kwargs):
388  """
389  Make a matplotlib errorbar plot, with all Hists in the stack overlaid.
390 
391  Passing 'offset=True' will slightly offset each dataset so overlapping
392  errorbars are still visible. Any additional keyword arguments will
393  be passed to :func:`matplotlib.pyplot.errorbar`.
394  """
395  plots = []
396  for i, hist in enumerate(self.hists):
397  if self.title is not None: hist.title = self.title
398  if self.xlabel is not None: hist.xlabel = self.xlabel
399  if self.ylabel is not None: hist.ylabel = self.ylabel
400  all_kwargs = copy.copy(kwargs)
401  all_kwargs.update(self.kwargs[i])
402  transform = plt.gca().transData
403  if offset:
404  index_offset = (len(self.hists) - 1)/2.
405  pixel_offset = 1./72 * (i - index_offset)
406  transform = transforms.ScaledTranslation(
407  pixel_offset, 0, plt.gcf().dpi_scale_trans)
408  transform = plt.gca().transData + transform
409  errorbar = hist.errorbar(transform=transform, **all_kwargs)
410  plots.append(errorbar)
411  return plots
def errorbar(self, offset=False, kwargs)
def python.rootplot.root2matplotlib.HistStack.errorbarh (   self,
  kwargs 
)
Make a horizontal matplotlib errorbar plot, with all Hists in the
stack overlaid.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.errorbar`.

Definition at line 412 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

412  def errorbarh(self, **kwargs):
413  """
414  Make a horizontal matplotlib errorbar plot, with all Hists in the
415  stack overlaid.
416 
417  Any additional keyword arguments will be passed to
418  :func:`matplotlib.pyplot.errorbar`.
419  """
420  plots = []
421  for i, hist in enumerate(self.hists):
422  if self.title is not None: hist.title = self.title
423  if self.xlabel is not None: hist.ylabel = self.xlabel
424  if self.ylabel is not None: hist.xlabel = self.ylabel
425  all_kwargs = copy.copy(kwargs)
426  all_kwargs.update(self.kwargs[i])
427  errorbar = hist.errorbarh(**all_kwargs)
428  plots.append(errorbar)
429  return plots
430 
def python.rootplot.root2matplotlib.HistStack.hist (   self,
  label_rotation = 0,
  kwargs 
)
Make a matplotlib hist plot.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.hist`, which allows a vast array of
possibilities.  Particlularly, the *histtype* values such as
``'barstacked'`` and ``'stepfilled'`` give substantially different
results.  You will probably want to include a transparency value
(i.e. *alpha* = 0.5).

Definition at line 241 of file root2matplotlib.py.

References histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, and python.rootplot.utilities.HistStack.kwargs.

241  def hist(self, label_rotation=0, **kwargs):
242  """
243  Make a matplotlib hist plot.
244 
245  Any additional keyword arguments will be passed to
246  :func:`matplotlib.pyplot.hist`, which allows a vast array of
247  possibilities. Particlularly, the *histtype* values such as
248  ``'barstacked'`` and ``'stepfilled'`` give substantially different
249  results. You will probably want to include a transparency value
250  (i.e. *alpha* = 0.5).
251  """
252  contents = np.dstack([hist.y for hist in self.hists])
253  xedges = self.hists[0].xedges
254  x = np.dstack([hist.x for hist in self.hists])[0]
255  labels = [hist.label for hist in self.hists]
256  try:
257  clist = [item['color'] for item in self.kwargs]
258  plt.gca().set_color_cycle(clist)
259  ## kwargs['color'] = clist # For newer version of matplotlib
260  except:
261  pass
262  plot = plt.hist(x, weights=contents, bins=xedges,
263  label=labels, **kwargs)
def hist(self, label_rotation=0, kwargs)
def python.rootplot.root2matplotlib.HistStack.histstack (   self,
  kwargs 
)
Make a matplotlib hist plot, with each Hist stacked upon the last.

Any additional keyword arguments will be passed to
:func:`matplotlib.pyplot.hist`.

Definition at line 307 of file root2matplotlib.py.

References objects.autophobj.float, histograms.Histograms.hists, python.rootplot.utilities.HistStack.hists, personalPlayback.Applet.kwargs, python.rootplot.utilities.HistStack.kwargs, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.title, TriggerOutputBranches::NamedBranchPtr.title, DB_ME.title, TableOutputBranches::NamedBranchPtr.title, cscdqm::HistoBookRequest.title, FWTriggerTableView::Column.title, DQMGenericClient::EfficOption.title, alignment.Alignment.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, HistogramManager.title, SiPixelTemplateHeader2D.title, presentation.SubsectionBase.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, python.rootplot.utilities.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.HistStack.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, python.rootplot.utilities.HistStack.ylabel, and rpcdqm::utils.ylabel.

307  def histstack(self, **kwargs):
308  """
309  Make a matplotlib hist plot, with each Hist stacked upon the last.
310 
311  Any additional keyword arguments will be passed to
312  :func:`matplotlib.pyplot.hist`.
313  """
314  bottom = None # if this is set to zeroes, it fails for log y
315  plots = []
316  cumhist = None
317  for i, hist in enumerate(self.hists):
318  if cumhist:
319  cumhist = hist + cumhist
320  else:
321  cumhist = copy.copy(hist)
322  if self.title is not None: cumhist.title = self.title
323  if self.xlabel is not None: cumhist.xlabel = self.xlabel
324  if self.ylabel is not None: cumhist.ylabel = self.ylabel
325  all_kwargs = copy.copy(kwargs)
326  all_kwargs.update(self.kwargs[i])
327  zorder = 0 + float(len(self) - i)/len(self) # plot in reverse order
328  plot = cumhist.hist(zorder=zorder, **all_kwargs)
329  plots.append(plot)
330  return plots
def python.rootplot.root2matplotlib.HistStack.show_titles (   self,
  kwargs 
)

Member Data Documentation

python.rootplot.root2matplotlib.HistStack.replacements

Definition at line 237 of file root2matplotlib.py.