CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.YErrorBars Class Reference

Public Member Functions

def __init__ (self, d=[], attr)
 
def __repr__ (self)
 
def SVG (self, trans=None)
 

Public Attributes

 attr
 
 d
 

Static Public Attributes

dictionary defaults = {"stroke-width":"0.25pt"}
 

Detailed Description

Draws y error bars at a set of points. This is usually used
before (under) a set of Dots at the same points.

YErrorBars(d, attribute=value)

d                       required        list of (x,y,yerr...) points
attribute=value pairs   keyword list    SVG attributes

If points in d have

    * 3 elements, the third is the symmetric error bar
    * 4 elements, the third and fourth are the asymmetric lower and
      upper error bar. The third element should be negative,
      e.g. (5, 5, -1, 2) is a bar from 4 to 7.
    * more than 4, a tick mark is placed at each value. This lets
      you nest errors from different sources, correlated and
      uncorrelated, statistical and systematic, etc.

Definition at line 3326 of file svgfig.py.

Constructor & Destructor Documentation

◆ __init__()

def svgfig.YErrorBars.__init__ (   self,
  d = [],
  attr 
)

Definition at line 3350 of file svgfig.py.

3350  def __init__(self, d=[], **attr):
3351  self.d = list(d)
3352 
3353  self.attr = dict(self.defaults)
3354  self.attr.update(attr)
3355 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
#define update(a, b)

Member Function Documentation

◆ __repr__()

def svgfig.YErrorBars.__repr__ (   self)

Definition at line 3347 of file svgfig.py.

References svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, svgfig.TextGlobal.d, svgfig.Dots.d, svgfig.XErrorBars.d, and svgfig.YErrorBars.d.

Referenced by data_sources.json_file.__str__(), and datamodel.Object.__str__().

3347  def __repr__(self):
3348  return "<YErrorBars (%d nodes)>" % len(self.d)
3349 

◆ SVG()

def svgfig.YErrorBars.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 3356 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, svgfig.Poly.attr, svgfig.Text.attr, svgfig.TextGlobal.attr, svgfig.Dots.attr, svgfig.Line.attr, svgfig.LineGlobal.attr, svgfig.VLine.attr, svgfig.HLine.attr, svgfig.Rect.attr, svgfig.Ellipse.attr, svgfig.Ticks.attr, svgfig.Axes.attr, svgfig.HGrid.attr, svgfig.VGrid.attr, svgfig.Grid.attr, svgfig.XErrorBars.attr, svgfig.YErrorBars.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, svgfig.TextGlobal.d, svgfig.Dots.d, svgfig.XErrorBars.d, svgfig.YErrorBars.d, WZElectronSkims53X_cff.max, SiStripPI.min, and svgfig.totrans().

3356  def SVG(self, trans=None):
3357  """Apply the transformation "trans" and return an SVG object."""
3358  if isinstance(trans, str): trans = totrans(trans) # only once
3359 
3360  output = SVG("g")
3361  for p in self.d:
3362  x, y = p[0], p[1]
3363 
3364  if len(p) == 3: bars = [y - p[2], y + p[2]]
3365  else: bars = [y + pi for pi in p[2:]]
3366 
3367  start, end = min(bars), max(bars)
3368  output.append(LineAxis(x, start, x, end, start, end, bars, False, False, **self.attr).SVG(trans))
3369 
3370  return output
3371 
def totrans(expr, vars=("x", "y"), globals=None, locals=None)
Definition: svgfig.py:598

Member Data Documentation

◆ attr

svgfig.YErrorBars.attr

Definition at line 3353 of file svgfig.py.

Referenced by svgfig.YErrorBars.SVG().

◆ d

svgfig.YErrorBars.d

Definition at line 3351 of file svgfig.py.

Referenced by svgfig.YErrorBars.__repr__(), and svgfig.YErrorBars.SVG().

◆ defaults

dictionary svgfig.YErrorBars.defaults = {"stroke-width":"0.25pt"}
static

Definition at line 3345 of file svgfig.py.

Referenced by tree.Tree.reset(), and tree.Tree.var().