CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, args, kwargs)
 
def bar (self, xerr=False, yerr=False, xoffset=0., width=0.8, label_rotation=0, label_alignment='center', kwargs)
 
def barh (self, xerr=False, yerr=False, yoffset=0., width=0.8, label_rotation=0, label_alignment='center', kwargs)
 
def errorbar (self, xerr=False, yerr=False, label_rotation=0, label_alignment='center', kwargs)
 
def errorbarh (self, xerr=False, yerr=False, label_rotation=0, label_alignment='center', kwargs)
 
def hist (self, label_rotation=0, label_alignment='center', kwargs)
 
def show_titles (self, kwargs)
 
- Public Member Functions inherited from python.rootplot.utilities.Hist
def __add__ (self, b)
 
def __div__ (self, denominator)
 
def __getitem__ (self, index)
 
def __init__ (self, hist, label="__nolabel__", name=None, title=None, xlabel=None, ylabel=None)
 
def __iter__ (self)
 
def __len__ (self)
 
def __setitem__ (self, index, value)
 
def __sub__ (self, b)
 
def av_xerr (self)
 
def av_yerr (self)
 
def delete_bin (self, index)
 
def divide (self, denominator)
 
def divide_wilson (self, denominator)
 
def min (self, threshold=None)
 
def scale (self, factor)
 
def TGraph (self, name=None)
 
def TH1F (self, name=None)
 

Public Attributes

 replacements
 
 y
 
- Public Attributes inherited from python.rootplot.utilities.Hist
 binlabels
 
 entries
 
 label
 
 name
 
 nbins
 
 overflow
 
 rootclass
 
 title
 
 underflow
 
 width
 
 x
 
 xedges
 
 xerr
 
 xlabel
 
 y
 
 yerr
 
 ylabel
 

Private Member Functions

def _prepare_xaxis (self, rotation=0, alignment='center')
 
def _prepare_yaxis (self, rotation=0, alignment='center')
 

Detailed Description

A container to hold the parameters from a ROOT histogram.

Definition at line 108 of file root2matplotlib.py.

Constructor & Destructor Documentation

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

Definition at line 110 of file root2matplotlib.py.

110  def __init__(self, *args, **kwargs):
111  self.replacements = None
112  if 'replacements' in kwargs:
113  self.replacements = kwargs.pop('replacements')
114  utilities.Hist.__init__(self, *args, **kwargs)

Member Function Documentation

def python.rootplot.root2matplotlib.Hist._prepare_xaxis (   self,
  rotation = 0,
  alignment = 'center' 
)
private
Apply bounds and text labels on x axis.

Definition at line 115 of file root2matplotlib.py.

References python.rootplot.utilities.Hist.binlabels, TriggerDQMBase::MEbinning.nbins, MEbinning.nbins, sistrip::EnsembleCalibrationLA.nbins, MEPSet.nbins, SummationStep.nbins, ExpressionHisto< T >.nbins, JetMonitor::MEbinning.nbins, METMonitor::MEbinning.nbins, HTMonitor::MEHTbinning.nbins, HistogramGenerator.nbins, DiDispStaMuonMonitor::MEbinning.nbins, NoBPTXMonitor::NoBPTXbinning.nbins, ecaldqm::binning::AxisSpecs.nbins, PlotAlignmentValidation::DMRPlotInfo.nbins, python.rootplot.utilities.Hist.nbins, MuonAlignment.nbins, HLTObjectsMonitor::MEbinning.nbins, MuScleFitUtils.nbins, MuonAlignmentAnalyzer.nbins, reco::MuonRPCHitMatch.x, RPFlatParams::EP.x, stAPVGain.x, TkLayerMap::XYbin.x, TwoBodyDecayParameters.x, SimplePixel.x, reco::MuonChamberMatch.x, online::BeamSpot_v1.x, HGCal_helpers::Coordinates.x, LHCInterpolatedOpticalFunctionsSet::Kinematics.x, Phase2ITPixelCluster::Pixel.x, reco::MuonSegmentMatch.x, SiPixelCluster::Pixel.x, PhiInterval.x, VertexType.x, Pixinfo.x, Hit.x, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.x, Clust.x, PixelModule.x, l1t::emtf::AMC13Header.x, python.rootplot.utilities.Hist2D.x, PixelUnpackingRegions::Module.x, Rechit.x, hit.x, CTPPSLocalTrackLite.x, MuonGeometryArrange::MGACollection.x, python.rootplot.utilities.Hist.x, BeamSpotOnlineRaw_v4.x, MuScleFitUtils.x, perftools::detail::Hist.x, edmStreamStallGrapher.Point.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, svgfig.TextGlobal.x, svgfig.VLine.x, python.rootplot.utilities.Hist2D.xedges, and python.rootplot.utilities.Hist.xedges.

Referenced by python.rootplot.root2matplotlib.Hist.bar(), and python.rootplot.root2matplotlib.Hist.errorbar().

115  def _prepare_xaxis(self, rotation=0, alignment='center'):
116  """Apply bounds and text labels on x axis."""
117  if self.binlabels is not None:
118  binwidth = (self.xedges[-1] - self.xedges[0]) / self.nbins
119  plt.xticks(self.x, self.binlabels,
120  rotation=rotation, ha=alignment)
121  plt.xlim(self.xedges[0], self.xedges[-1])
122 
def _prepare_xaxis(self, rotation=0, alignment='center')
def python.rootplot.root2matplotlib.Hist._prepare_yaxis (   self,
  rotation = 0,
  alignment = 'center' 
)
private
Apply bounds and text labels on y axis.

Definition at line 123 of file root2matplotlib.py.

References python.rootplot.utilities.Hist.binlabels, TriggerDQMBase::MEbinning.nbins, MEbinning.nbins, sistrip::EnsembleCalibrationLA.nbins, MEPSet.nbins, SummationStep.nbins, ExpressionHisto< T >.nbins, JetMonitor::MEbinning.nbins, METMonitor::MEbinning.nbins, HTMonitor::MEHTbinning.nbins, HistogramGenerator.nbins, DiDispStaMuonMonitor::MEbinning.nbins, NoBPTXMonitor::NoBPTXbinning.nbins, ecaldqm::binning::AxisSpecs.nbins, PlotAlignmentValidation::DMRPlotInfo.nbins, python.rootplot.utilities.Hist.nbins, MuonAlignment.nbins, HLTObjectsMonitor::MEbinning.nbins, MuScleFitUtils.nbins, MuonAlignmentAnalyzer.nbins, reco::MuonRPCHitMatch.x, RPFlatParams::EP.x, stAPVGain.x, TkLayerMap::XYbin.x, TwoBodyDecayParameters.x, SimplePixel.x, reco::MuonChamberMatch.x, online::BeamSpot_v1.x, HGCal_helpers::Coordinates.x, LHCInterpolatedOpticalFunctionsSet::Kinematics.x, Phase2ITPixelCluster::Pixel.x, reco::MuonSegmentMatch.x, SiPixelCluster::Pixel.x, PhiInterval.x, VertexType.x, Pixinfo.x, Hit.x, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.x, Clust.x, PixelModule.x, l1t::emtf::AMC13Header.x, python.rootplot.utilities.Hist2D.x, PixelUnpackingRegions::Module.x, Rechit.x, hit.x, CTPPSLocalTrackLite.x, MuonGeometryArrange::MGACollection.x, python.rootplot.utilities.Hist.x, BeamSpotOnlineRaw_v4.x, MuScleFitUtils.x, perftools::detail::Hist.x, edmStreamStallGrapher.Point.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, svgfig.TextGlobal.x, svgfig.VLine.x, python.rootplot.utilities.Hist2D.xedges, and python.rootplot.utilities.Hist.xedges.

Referenced by python.rootplot.root2matplotlib.Hist.barh(), and python.rootplot.root2matplotlib.Hist.errorbarh().

123  def _prepare_yaxis(self, rotation=0, alignment='center'):
124  """Apply bounds and text labels on y axis."""
125  if self.binlabels is not None:
126  binwidth = (self.xedges[-1] - self.xedges[0]) / self.nbins
127  plt.yticks(self.x, self.binlabels,
128  rotation=rotation, va=alignment)
129  plt.ylim(self.xedges[0], self.xedges[-1])
130 
def _prepare_yaxis(self, rotation=0, alignment='center')
def python.rootplot.root2matplotlib.Hist.bar (   self,
  xerr = False,
  yerr = False,
  xoffset = 0.,
  width = 0.8,
  label_rotation = 0,
  label_alignment = 'center',
  kwargs 
)
Generate a matplotlib bar figure.

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

Definition at line 189 of file root2matplotlib.py.

References python.rootplot.root2matplotlib.Hist._prepare_xaxis(), python.rootplot.utilities.Hist.av_xerr(), python.rootplot.utilities.Hist.av_yerr(), python.rootplot.root2matplotlib.Hist.barh(), python.readProv.filereader.Module.label, core.AutoHandle.AutoHandle.label, L1TriggerKeyExtViewer.label, SubDetParams.label, ElectronLikelihoodCategoryData.label, entry< T >.label, SiPixelFedFillerWordEventNumber.label, classes.PlotData.label, l1t::L1GtBoardTypeStringToEnum.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, L1GtBoardTypeStringToEnum.label, ConverterTester.label, l1t::L1TGtObjectStringToEnum.label, L1GtObjectStringToEnum.label, TaggingVariablePlotter::VariableConfig.label, SiPixelRawToDigi.label, SiPixelQualityESProducer.label, muon::SelectionTypeStringToEnum.label, HLTVertexPerformanceAnalyzer.label, hltPlot.label, FWPSetTableManager::PSetData.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label, L1GtPsbQuadStringToEnum.label, PhysicsTools::MVAModuleHelper< Record, Object, Filler >.label, python.rootplot.utilities.Hist2D.label, l1t::GtConditionTypeStringToEnum.label, DependencyGraph::node.label, MatrixInjector.MatrixInjector.label, ValidationMisalignedTracker.label, HLTBTagPerformanceAnalyzer.label, l1t::GtConditionCategoryStringToEnum.label, MatrixUtil.InputInfo.label, L1GtConditionTypeStringToEnum.label, python.rootplot.utilities.Hist.label, cond::payloadInspector::ModuleVersion.label, L1GtConditionCategoryStringToEnum.label, FastTimerService::GroupOfModules.label, ScaleVarWeight.label, JsonOutputProducer::JsonVars.label, python.rootplot.root2matplotlib.replace(), python.rootplot.root2matplotlib.Hist2D.replacements, python.rootplot.root2matplotlib.Hist.replacements, TmModule.width, DDTIDAxialCableAlgo.width, DDTECAxialCableAlgo.width, reco::CastorJetID.width, function::ZMuStandaloneFunction.width, function::ZMuMuFunction.width, function::ZMuMuScaledFunction.width, function::ZMuTrackFunction.width, btag::SimpleMatrix< T >.width, function::ZMuStandaloneScaledFunction.width, function::ZMuTrackScaledFunction.width, function::ZMuTrackScaledNormalBack.width, presentation.PageLayout.width, ProcNormalize::Map.width, DaqFakeReader.width, ProcLikelihood::SplinePDF.width, SiStripMonitorCluster::ClusterProperties.width, python.rootplot.utilities.Hist.width, TkAlMap.TkAlMap.width, dqmTnP::VoigtianPlusExponentialFitter.width, svgfig.Plot.width, svgfig.Frame.width, svgfig.Dots.width, python.rootplot.utilities.Hist2D.xedges, python.rootplot.utilities.Hist.xedges, RPFlatParams::EP.y, stAPVGain.y, TwoBodyDecayParameters.y, TkLayerMap::XYbin.y, SimplePixel.y, reco::MuonChamberMatch.y, online::BeamSpot_v1.y, HGCal_helpers::Coordinates.y, Phase2ITPixelCluster::Pixel.y, LHCInterpolatedOpticalFunctionsSet::Kinematics.y, reco::MuonSegmentMatch.y, PhiInterval.y, SiPixelCluster::Pixel.y, VertexType.y, Pixinfo.y, Hit.y, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.y, PixelModule.y, Clust.y, PixelUnpackingRegions::Module.y, Rechit.y, hit.y, MuonGeometryArrange::MGACollection.y, CTPPSLocalTrackLite.y, python.rootplot.root2matplotlib.Hist.y, BeamSpotOnlineRaw_v4.y, Exhume::CrossSection.y, edmStreamStallGrapher.Point.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, svgfig.Text.y, svgfig.TextGlobal.y, and svgfig.HLine.y.

Referenced by python.rootplot.root2matplotlib.Hist.errorbarh().

189  label_rotation=0, label_alignment='center', **kwargs):
190  """
191  Generate a matplotlib bar figure.
192 
193  All additional keyword arguments will be passed to
194  :func:`matplotlib.pyplot.bar`.
195  """
196  kwargs.pop('fmt', None)
197  if xerr: kwargs['xerr'] = self.av_xerr()
198  if yerr: kwargs['yerr'] = self.av_yerr()
199  replacements = kwargs.get('replacements', None) or self.replacements
200  ycontent = [self.xedges[i] + self.width[i] * xoffset
201  for i in range(len(self.xedges) - 1)]
202  width = [x * width for x in self.width]
203  bar = plt.bar(ycontent, self.y, width,
204  label=replace(self.label, replacements), **kwargs)
205  self._prepare_xaxis(label_rotation, label_alignment)
206  return bar
def replace(string, replacements)
def _prepare_xaxis(self, rotation=0, alignment='center')
def python.rootplot.root2matplotlib.Hist.barh (   self,
  xerr = False,
  yerr = False,
  yoffset = 0.,
  width = 0.8,
  label_rotation = 0,
  label_alignment = 'center',
  kwargs 
)
Generate a horizontal matplotlib bar figure.

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

Definition at line 208 of file root2matplotlib.py.

References python.rootplot.root2matplotlib.Hist._prepare_yaxis(), python.rootplot.utilities.Hist.av_xerr(), python.rootplot.utilities.Hist.av_yerr(), python.readProv.filereader.Module.label, core.AutoHandle.AutoHandle.label, L1TriggerKeyExtViewer.label, SubDetParams.label, ElectronLikelihoodCategoryData.label, entry< T >.label, SiPixelFedFillerWordEventNumber.label, classes.PlotData.label, l1t::L1GtBoardTypeStringToEnum.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, L1GtBoardTypeStringToEnum.label, ConverterTester.label, l1t::L1TGtObjectStringToEnum.label, L1GtObjectStringToEnum.label, TaggingVariablePlotter::VariableConfig.label, SiPixelRawToDigi.label, SiPixelQualityESProducer.label, muon::SelectionTypeStringToEnum.label, HLTVertexPerformanceAnalyzer.label, hltPlot.label, FWPSetTableManager::PSetData.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label, L1GtPsbQuadStringToEnum.label, PhysicsTools::MVAModuleHelper< Record, Object, Filler >.label, python.rootplot.utilities.Hist2D.label, l1t::GtConditionTypeStringToEnum.label, DependencyGraph::node.label, MatrixInjector.MatrixInjector.label, ValidationMisalignedTracker.label, HLTBTagPerformanceAnalyzer.label, l1t::GtConditionCategoryStringToEnum.label, MatrixUtil.InputInfo.label, L1GtConditionTypeStringToEnum.label, python.rootplot.utilities.Hist.label, cond::payloadInspector::ModuleVersion.label, L1GtConditionCategoryStringToEnum.label, FastTimerService::GroupOfModules.label, ScaleVarWeight.label, JsonOutputProducer::JsonVars.label, python.rootplot.root2matplotlib.replace(), python.rootplot.root2matplotlib.Hist2D.replacements, python.rootplot.root2matplotlib.Hist.replacements, TmModule.width, DDTIDAxialCableAlgo.width, DDTECAxialCableAlgo.width, reco::CastorJetID.width, function::ZMuStandaloneFunction.width, function::ZMuMuFunction.width, function::ZMuMuScaledFunction.width, function::ZMuTrackFunction.width, btag::SimpleMatrix< T >.width, function::ZMuStandaloneScaledFunction.width, function::ZMuTrackScaledFunction.width, function::ZMuTrackScaledNormalBack.width, presentation.PageLayout.width, ProcNormalize::Map.width, DaqFakeReader.width, ProcLikelihood::SplinePDF.width, SiStripMonitorCluster::ClusterProperties.width, python.rootplot.utilities.Hist.width, TkAlMap.TkAlMap.width, dqmTnP::VoigtianPlusExponentialFitter.width, svgfig.Plot.width, svgfig.Frame.width, svgfig.Dots.width, python.rootplot.utilities.Hist2D.xedges, python.rootplot.utilities.Hist.xedges, RPFlatParams::EP.y, stAPVGain.y, TwoBodyDecayParameters.y, TkLayerMap::XYbin.y, SimplePixel.y, reco::MuonChamberMatch.y, online::BeamSpot_v1.y, HGCal_helpers::Coordinates.y, Phase2ITPixelCluster::Pixel.y, LHCInterpolatedOpticalFunctionsSet::Kinematics.y, reco::MuonSegmentMatch.y, PhiInterval.y, SiPixelCluster::Pixel.y, VertexType.y, Pixinfo.y, Hit.y, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.y, PixelModule.y, Clust.y, PixelUnpackingRegions::Module.y, Rechit.y, hit.y, MuonGeometryArrange::MGACollection.y, CTPPSLocalTrackLite.y, python.rootplot.root2matplotlib.Hist.y, BeamSpotOnlineRaw_v4.y, Exhume::CrossSection.y, edmStreamStallGrapher.Point.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, svgfig.Text.y, svgfig.TextGlobal.y, and svgfig.HLine.y.

Referenced by python.rootplot.root2matplotlib.Hist.bar().

208  label_rotation=0, label_alignment='center', **kwargs):
209  """
210  Generate a horizontal matplotlib bar figure.
211 
212  All additional keyword arguments will be passed to
213  :func:`matplotlib.pyplot.bar`.
214  """
215  kwargs.pop('fmt', None)
216  if xerr: kwargs['xerr'] = self.av_yerr()
217  if yerr: kwargs['yerr'] = self.av_xerr()
218  replacements = kwargs.get('replacements', None) or self.replacements
219  xcontent = [self.xedges[i] + self.width[i] * yoffset
220  for i in range(len(self.xedges) - 1)]
221  width = [x * width for x in self.width]
222  barh = plt.barh(xcontent, self.y, width,
223  label=replace(self.label, replacements),
224  **kwargs)
225  self._prepare_yaxis(label_rotation, label_alignment)
226  return barh
227 
def replace(string, replacements)
def _prepare_yaxis(self, rotation=0, alignment='center')
def python.rootplot.root2matplotlib.Hist.errorbar (   self,
  xerr = False,
  yerr = False,
  label_rotation = 0,
  label_alignment = 'center',
  kwargs 
)
Generate a matplotlib errorbar figure.

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

Definition at line 155 of file root2matplotlib.py.

References python.rootplot.root2matplotlib.Hist._prepare_xaxis(), python.rootplot.root2matplotlib.Hist.errorbarh(), python.readProv.filereader.Module.label, core.AutoHandle.AutoHandle.label, L1TriggerKeyExtViewer.label, SubDetParams.label, ElectronLikelihoodCategoryData.label, entry< T >.label, classes.PlotData.label, SiPixelFedFillerWordEventNumber.label, l1t::L1GtBoardTypeStringToEnum.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, L1GtBoardTypeStringToEnum.label, ConverterTester.label, l1t::L1TGtObjectStringToEnum.label, L1GtObjectStringToEnum.label, TaggingVariablePlotter::VariableConfig.label, SiPixelRawToDigi.label, SiPixelQualityESProducer.label, muon::SelectionTypeStringToEnum.label, HLTVertexPerformanceAnalyzer.label, hltPlot.label, FWPSetTableManager::PSetData.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label, L1GtPsbQuadStringToEnum.label, PhysicsTools::MVAModuleHelper< Record, Object, Filler >.label, python.rootplot.utilities.Hist2D.label, l1t::GtConditionTypeStringToEnum.label, DependencyGraph::node.label, MatrixInjector.MatrixInjector.label, ValidationMisalignedTracker.label, HLTBTagPerformanceAnalyzer.label, l1t::GtConditionCategoryStringToEnum.label, MatrixUtil.InputInfo.label, L1GtConditionTypeStringToEnum.label, python.rootplot.utilities.Hist.label, cond::payloadInspector::ModuleVersion.label, L1GtConditionCategoryStringToEnum.label, FastTimerService::GroupOfModules.label, ScaleVarWeight.label, JsonOutputProducer::JsonVars.label, python.rootplot.root2matplotlib.replace(), python.rootplot.root2matplotlib.Hist2D.replacements, python.rootplot.root2matplotlib.Hist.replacements, reco::MuonRPCHitMatch.x, RPFlatParams::EP.x, stAPVGain.x, TkLayerMap::XYbin.x, TwoBodyDecayParameters.x, SimplePixel.x, reco::MuonChamberMatch.x, online::BeamSpot_v1.x, HGCal_helpers::Coordinates.x, Phase2ITPixelCluster::Pixel.x, LHCInterpolatedOpticalFunctionsSet::Kinematics.x, reco::MuonSegmentMatch.x, SiPixelCluster::Pixel.x, PhiInterval.x, VertexType.x, Pixinfo.x, Hit.x, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.x, Clust.x, PixelModule.x, l1t::emtf::AMC13Header.x, python.rootplot.utilities.Hist2D.x, PixelUnpackingRegions::Module.x, Rechit.x, hit.x, CTPPSLocalTrackLite.x, MuonGeometryArrange::MGACollection.x, python.rootplot.utilities.Hist.x, BeamSpotOnlineRaw_v4.x, MuScleFitUtils.x, perftools::detail::Hist.x, edmStreamStallGrapher.Point.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, svgfig.TextGlobal.x, svgfig.VLine.x, PrimaryVertexMonitor.xerr, python.rootplot.utilities.Hist.xerr, RPFlatParams::EP.y, stAPVGain.y, TkLayerMap::XYbin.y, TwoBodyDecayParameters.y, SimplePixel.y, reco::MuonChamberMatch.y, online::BeamSpot_v1.y, HGCal_helpers::Coordinates.y, Phase2ITPixelCluster::Pixel.y, LHCInterpolatedOpticalFunctionsSet::Kinematics.y, reco::MuonSegmentMatch.y, PhiInterval.y, SiPixelCluster::Pixel.y, VertexType.y, Pixinfo.y, Hit.y, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.y, PixelModule.y, Clust.y, PixelUnpackingRegions::Module.y, Rechit.y, hit.y, MuonGeometryArrange::MGACollection.y, CTPPSLocalTrackLite.y, python.rootplot.root2matplotlib.Hist.y, BeamSpotOnlineRaw_v4.y, Exhume::CrossSection.y, edmStreamStallGrapher.Point.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, svgfig.Text.y, svgfig.TextGlobal.y, svgfig.HLine.y, PrimaryVertexMonitor.yerr, and python.rootplot.utilities.Hist.yerr.

155  label_alignment='center', **kwargs):
156  """
157  Generate a matplotlib errorbar figure.
158 
159  All additional keyword arguments will be passed to
160  :func:`matplotlib.pyplot.errorbar`.
161  """
162  if xerr:
163  kwargs['xerr'] = self.xerr
164  if yerr:
165  kwargs['yerr'] = self.yerr
166  replacements = kwargs.get('replacements', None) or self.replacements
167  errorbar = plt.errorbar(self.x, self.y,
168  label=replace(self.label, replacements),
169  **kwargs)
170  self._prepare_xaxis(label_rotation, label_alignment)
171  return errorbar
def replace(string, replacements)
def _prepare_xaxis(self, rotation=0, alignment='center')
def python.rootplot.root2matplotlib.Hist.errorbarh (   self,
  xerr = False,
  yerr = False,
  label_rotation = 0,
  label_alignment = 'center',
  kwargs 
)
Generate a horizontal matplotlib errorbar figure.

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

Definition at line 173 of file root2matplotlib.py.

References python.rootplot.root2matplotlib.Hist._prepare_yaxis(), python.rootplot.root2matplotlib.Hist.bar(), python.readProv.filereader.Module.label, core.AutoHandle.AutoHandle.label, L1TriggerKeyExtViewer.label, SubDetParams.label, ElectronLikelihoodCategoryData.label, entry< T >.label, classes.PlotData.label, SiPixelFedFillerWordEventNumber.label, l1t::L1GtBoardTypeStringToEnum.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, L1GtBoardTypeStringToEnum.label, ConverterTester.label, l1t::L1TGtObjectStringToEnum.label, L1GtObjectStringToEnum.label, TaggingVariablePlotter::VariableConfig.label, SiPixelRawToDigi.label, SiPixelQualityESProducer.label, muon::SelectionTypeStringToEnum.label, HLTVertexPerformanceAnalyzer.label, hltPlot.label, FWPSetTableManager::PSetData.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label, L1GtPsbQuadStringToEnum.label, PhysicsTools::MVAModuleHelper< Record, Object, Filler >.label, python.rootplot.utilities.Hist2D.label, l1t::GtConditionTypeStringToEnum.label, DependencyGraph::node.label, MatrixInjector.MatrixInjector.label, ValidationMisalignedTracker.label, HLTBTagPerformanceAnalyzer.label, l1t::GtConditionCategoryStringToEnum.label, MatrixUtil.InputInfo.label, L1GtConditionTypeStringToEnum.label, python.rootplot.utilities.Hist.label, cond::payloadInspector::ModuleVersion.label, L1GtConditionCategoryStringToEnum.label, FastTimerService::GroupOfModules.label, ScaleVarWeight.label, JsonOutputProducer::JsonVars.label, python.rootplot.root2matplotlib.replace(), python.rootplot.root2matplotlib.Hist2D.replacements, python.rootplot.root2matplotlib.Hist.replacements, reco::MuonRPCHitMatch.x, RPFlatParams::EP.x, stAPVGain.x, TwoBodyDecayParameters.x, TkLayerMap::XYbin.x, SimplePixel.x, reco::MuonChamberMatch.x, online::BeamSpot_v1.x, HGCal_helpers::Coordinates.x, Phase2ITPixelCluster::Pixel.x, LHCInterpolatedOpticalFunctionsSet::Kinematics.x, reco::MuonSegmentMatch.x, SiPixelCluster::Pixel.x, PhiInterval.x, VertexType.x, Pixinfo.x, Hit.x, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.x, Clust.x, PixelModule.x, l1t::emtf::AMC13Header.x, python.rootplot.utilities.Hist2D.x, PixelUnpackingRegions::Module.x, Rechit.x, hit.x, CTPPSLocalTrackLite.x, MuonGeometryArrange::MGACollection.x, python.rootplot.utilities.Hist.x, BeamSpotOnlineRaw_v4.x, MuScleFitUtils.x, perftools::detail::Hist.x, edmStreamStallGrapher.Point.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, svgfig.TextGlobal.x, svgfig.VLine.x, PrimaryVertexMonitor.xerr, python.rootplot.utilities.Hist.xerr, RPFlatParams::EP.y, stAPVGain.y, TwoBodyDecayParameters.y, TkLayerMap::XYbin.y, SimplePixel.y, reco::MuonChamberMatch.y, online::BeamSpot_v1.y, HGCal_helpers::Coordinates.y, Phase2ITPixelCluster::Pixel.y, LHCInterpolatedOpticalFunctionsSet::Kinematics.y, reco::MuonSegmentMatch.y, PhiInterval.y, SiPixelCluster::Pixel.y, VertexType.y, Pixinfo.y, Hit.y, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.y, PixelModule.y, Clust.y, PixelUnpackingRegions::Module.y, Rechit.y, hit.y, MuonGeometryArrange::MGACollection.y, CTPPSLocalTrackLite.y, python.rootplot.root2matplotlib.Hist.y, BeamSpotOnlineRaw_v4.y, Exhume::CrossSection.y, edmStreamStallGrapher.Point.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, svgfig.Text.y, svgfig.TextGlobal.y, svgfig.HLine.y, PrimaryVertexMonitor.yerr, and python.rootplot.utilities.Hist.yerr.

Referenced by python.rootplot.root2matplotlib.Hist.errorbar().

173  label_alignment='center', **kwargs):
174  """
175  Generate a horizontal matplotlib errorbar figure.
176 
177  All additional keyword arguments will be passed to
178  :func:`matplotlib.pyplot.errorbar`.
179  """
180  if xerr: kwargs['xerr'] = self.yerr
181  if yerr: kwargs['yerr'] = self.xerr
182  replacements = kwargs.get('replacements', None) or self.replacements
183  errorbar = plt.errorbar(self.y, self.x,
184  label=replace(self.label, replacements),
185  **kwargs)
186  self._prepare_yaxis(label_rotation, label_alignment)
187  return errorbar
def replace(string, replacements)
def _prepare_yaxis(self, rotation=0, alignment='center')
def python.rootplot.root2matplotlib.Hist.hist (   self,
  label_rotation = 0,
  label_alignment = 'center',
  kwargs 
)
Generate a matplotlib hist figure.

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

Definition at line 137 of file root2matplotlib.py.

References python.rootplot.root2matplotlib.Hist2D.replacements, python.rootplot.root2matplotlib.Hist.replacements, RPFlatParams::EP.y, stAPVGain.y, TkLayerMap::XYbin.y, TwoBodyDecayParameters.y, SimplePixel.y, reco::MuonChamberMatch.y, online::BeamSpot_v1.y, HGCal_helpers::Coordinates.y, Phase2ITPixelCluster::Pixel.y, LHCInterpolatedOpticalFunctionsSet::Kinematics.y, reco::MuonSegmentMatch.y, PhiInterval.y, SiPixelCluster::Pixel.y, VertexType.y, Pixinfo.y, Hit.y, MonitorTrackResidualsBase< pixel_or_strip >::HistoXY.y, PixelModule.y, Clust.y, PixelUnpackingRegions::Module.y, Rechit.y, hit.y, MuonGeometryArrange::MGACollection.y, CTPPSLocalTrackLite.y, python.rootplot.root2matplotlib.Hist.y, BeamSpotOnlineRaw_v4.y, Exhume::CrossSection.y, edmStreamStallGrapher.Point.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, svgfig.Text.y, svgfig.TextGlobal.y, and svgfig.HLine.y.

137  def hist(self, label_rotation=0, label_alignment='center', **kwargs):
138  """
139  Generate a matplotlib hist figure.
140 
141  All additional keyword arguments will be passed to
142  :func:`matplotlib.pyplot.hist`.
143  """
144  kwargs.pop('fmt', None)
145  replacements = kwargs.get('replacements', None) or self.replacements
146  weights = self.y
147  # Kludge to avoid mpl bug when plotting all zeros
148  if self.y == [0] * self.nbins:
149  weights = [1.e-10] * self.nbins
150  plot = plt.hist(self.x, weights=weights, bins=self.xedges,
151  label=replace(self.label, replacements), **kwargs)
152  self._prepare_xaxis(label_rotation, label_alignment)
153  return plot
def replace(string, replacements)
def _prepare_xaxis(self, rotation=0, alignment='center')
def hist(self, label_rotation=0, label_alignment='center', kwargs)
def python.rootplot.root2matplotlib.Hist.show_titles (   self,
  kwargs 
)
Print the title and axis labels to the current figure.

Definition at line 131 of file root2matplotlib.py.

References python.rootplot.root2matplotlib.replace(), python.rootplot.root2matplotlib.Hist2D.replacements, python.rootplot.root2matplotlib.Hist.replacements, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, TriggerOutputBranches::NamedBranchPtr.title, preexistingValidation.PreexistingValidation.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, ecaldqm::binning::AxisSpecs.title, python.rootplot.utilities.Hist2D.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.Hist2D.xlabel, HistogramManager.xlabel, python.rootplot.utilities.Hist.xlabel, python.rootplot.utilities.Hist2D.ylabel, HistogramManager.ylabel, python.rootplot.utilities.Hist.ylabel, and rpcdqm::utils.ylabel.

131  def show_titles(self, **kwargs):
132  """Print the title and axis labels to the current figure."""
133  replacements = kwargs.get('replacements', None) or self.replacements
134  plt.title(replace(self.title, replacements))
135  plt.xlabel(replace(self.xlabel, replacements))
136  plt.ylabel(replace(self.ylabel, replacements))
def replace(string, replacements)

Member Data Documentation

python.rootplot.root2matplotlib.Hist.replacements
python.rootplot.root2matplotlib.Hist.y