CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

svgfig::YErrorBars Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def SVG

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 3327 of file svgfig.py.


Constructor & Destructor Documentation

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

Definition at line 3351 of file svgfig.py.

03352                                   :
03353     self.d = list(d)
03354 
03355     self.attr = dict(self.defaults)
03356     self.attr.update(attr)
    

Member Function Documentation

def svgfig::YErrorBars::__repr__ (   self)

Definition at line 3348 of file svgfig.py.

03349                     :
03350     return "<YErrorBars (%d nodes)>" % len(self.d)

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

Definition at line 3357 of file svgfig.py.

03358                            :
03359     """Apply the transformation "trans" and return an SVG object."""
03360     if isinstance(trans, basestring): trans = totrans(trans) # only once
03361 
03362     output = SVG("g")
03363     for p in self.d:
03364       x, y = p[0], p[1]
03365 
03366       if len(p) == 3: bars = [y - p[2], y + p[2]]
03367       else: bars = [y + pi for pi in p[2:]]
03368       
03369       start, end = min(bars), max(bars)
03370       output.append(LineAxis(x, start, x, end, start, end, bars, False, False, **self.attr).SVG(trans))
03371 
03372     return output

Member Data Documentation

Definition at line 3351 of file svgfig.py.

Definition at line 3351 of file svgfig.py.

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

Definition at line 3346 of file svgfig.py.