CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, xmin, xmax, ymin, ymax, atx=0, aty=0, xticks=-10, xminiticks=True, xlabels=True, xlogbase=None, yticks=-10, yminiticks=True, ylabels=True, ylogbase=None, arrows=None, text_attr={}, attr)
 
def __repr__ (self)
 
def SVG (self, trans=None)
 

Public Attributes

 arrows
 
 attr
 
 aty
 
 text_attr
 
 xlogbase
 
 xmax
 
 ylogbase
 
 ymax
 

Static Public Attributes

dictionary defaults = {"stroke-width":"0.25pt"}
 
dictionary text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
 

Detailed Description

Draw a pair of intersecting x-y axes.

Axes(xmin, xmax, ymin, ymax, atx, aty, xticks, xminiticks, xlabels, xlogbase,
yticks, yminiticks, ylabels, ylogbase, arrows, text_attr, attribute=value)

xmin, xmax               required       the x range
ymin, ymax               required       the y range
atx, aty                 default=0, 0   point where the axes try to cross;
                                        if outside the range, the axes will
                                        cross at the closest corner
xticks                   default=-10    request ticks according to the standard
                                        tick specification (see help(Ticks))
xminiticks               default=True   request miniticks according to the
                                        standard minitick specification
xlabels                  True           request tick labels according to the
                                        standard tick label specification
xlogbase                 default=None   if a number, the x axis is logarithmic
                                        with ticks at the given base (usually 10)
yticks                   default=-10    request ticks according to the standard
                                        tick specification
yminiticks               default=True   request miniticks according to the
                                        standard minitick specification
ylabels                  True           request tick labels according to the
                                        standard tick label specification
ylogbase                 default=None   if a number, the y axis is logarithmic
                                        with ticks at the given base (usually 10)
arrows                   default=None   if a new string identifier, draw arrows
                                        referenced by that identifier
text_attr                default={}     SVG attributes for the text labels
attribute=value pairs    keyword list   SVG attributes for all lines

Definition at line 3040 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Axes.__init__ (   self,
  xmin,
  xmax,
  ymin,
  ymax,
  atx = 0,
  aty = 0,
  xticks = -10,
  xminiticks = True,
  xlabels = True,
  xlogbase = None,
  yticks = -10,
  yminiticks = True,
  ylabels = True,
  ylogbase = None,
  arrows = None,
  text_attr = {},
  attr 
)

Definition at line 3078 of file svgfig.py.

3078  def __init__(self, xmin, xmax, ymin, ymax, atx=0, aty=0, xticks=-10, xminiticks=True, xlabels=True, xlogbase=None, yticks=-10, yminiticks=True, ylabels=True, ylogbase=None, arrows=None, text_attr={}, **attr):
3079  self.xmin, self.xmax = xmin, xmax
3080  self.ymin, self.ymax = ymin, ymax
3081  self.atx, self.aty = atx, aty
3082  self.xticks, self.xminiticks, self.xlabels, self.xlogbase = xticks, xminiticks, xlabels, xlogbase
3083  self.yticks, self.yminiticks, self.ylabels, self.ylogbase = yticks, yminiticks, ylabels, ylogbase
3084  self.arrows = arrows
3085 
3087  self.text_attr.update(text_attr)
3088 
3089  self.attr = dict(self.defaults)
3090  self.attr.update(attr)
3091 
def __init__(self, xmin, xmax, ymin, ymax, atx=0, aty=0, xticks=-10, xminiticks=True, xlabels=True, xlogbase=None, yticks=-10, yminiticks=True, ylabels=True, ylogbase=None, arrows=None, text_attr={}, attr)
Definition: svgfig.py:3078
dictionary text_defaults
Definition: svgfig.py:3073
dictionary defaults
Definition: svgfig.py:3072

Member Function Documentation

def svgfig.Axes.__repr__ (   self)

Definition at line 3075 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.Plot.atx, svgfig.YAxis.atx, svgfig.Plot.aty, svgfig.XAxis.aty, svgfig.Axes.aty, svgfig.Axes.xmax, TriggerDQMBase::MEbinning.xmin, fftjetcms::LookupTable2d.xmin(), MEbinning.xmin, PixelClusterizerBase::AccretionCluster.xmin, AbsHcalFunctor.xmin(), MEPSet.xmin, HcalLinearCompositionFunctor.xmin(), HcalChebyshevFunctor.xmin(), HcalCubicInterpolator.xmin(), HcalInterpolatedTableFunctor.xmin(), HcalPolynomialFunctor.xmin(), ClusterizingHistogram.xmin, HcalPiecewiseLinearFunctor.xmin(), SummationStep.xmin, BremsstrahlungSimulator.xmin, JetMonitor::MEbinning.xmin, METMonitor::MEbinning.xmin, HTMonitor::MEHTbinning.xmin, GammaFunctionGenerator.xmin, fftjetcms::LinInterpolatedTable1D.xmin(), MuonBremsstrahlungSimulator.xmin, dqmoffline::l1t::HistDefinition.xmin, BaseNumericalRandomGenerator.xmin, DiDispStaMuonMonitor::MEbinning.xmin, NoBPTXMonitor::NoBPTXbinning.xmin, HLTObjectsMonitor::MEbinning.xmin, cscdqm::AddressBox.xmin, TrackerMap.xmin, svgfig.Plot.ymax, svgfig.Frame.ymax, svgfig.Axes.ymax, fftjetcms::LookupTable2d.ymin(), PixelClusterizerBase::AccretionCluster.ymin, dqmoffline::l1t::HistDefinition.ymin, Exhume::Event.ymin, cscdqm::AddressBox.ymin, and TrackerMap.ymin.

Referenced by data_sources.json_file.__str__().

3075  def __repr__(self):
3076  return "<Axes x=(%g, %g) y=(%g, %g) at (%g, %g) %s>" % (self.xmin, self.xmax, self.ymin, self.ymax, self.atx, self.aty, self.attr)
3077 
def __repr__(self)
Definition: svgfig.py:3075
def svgfig.Axes.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 3092 of file svgfig.py.

References funct.abs(), svgfig.Plot.arrows, svgfig.Axes.arrows, 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.Plot.atx, svgfig.YAxis.atx, svgfig.Plot.aty, svgfig.XAxis.aty, svgfig.Axes.aty, svgfig.Plot.text_attr, svgfig.Frame.text_attr, svgfig.Ticks.text_attr, svgfig.Axes.text_attr, svgfig.Plot.xlabels, svgfig.Frame.xlabels, svgfig.Plot.xlogbase, svgfig.Frame.xlogbase, svgfig.Axes.xlogbase, svgfig.Axes.xmax, TriggerDQMBase::MEbinning.xmin, fftjetcms::LookupTable2d.xmin(), MEbinning.xmin, PixelClusterizerBase::AccretionCluster.xmin, AbsHcalFunctor.xmin(), MEPSet.xmin, HcalLinearCompositionFunctor.xmin(), HcalChebyshevFunctor.xmin(), HcalCubicInterpolator.xmin(), HcalInterpolatedTableFunctor.xmin(), HcalPolynomialFunctor.xmin(), ClusterizingHistogram.xmin, HcalPiecewiseLinearFunctor.xmin(), BremsstrahlungSimulator.xmin, SummationStep.xmin, JetMonitor::MEbinning.xmin, METMonitor::MEbinning.xmin, HTMonitor::MEHTbinning.xmin, GammaFunctionGenerator.xmin, fftjetcms::LinInterpolatedTable1D.xmin(), MuonBremsstrahlungSimulator.xmin, BaseNumericalRandomGenerator.xmin, dqmoffline::l1t::HistDefinition.xmin, DiDispStaMuonMonitor::MEbinning.xmin, NoBPTXMonitor::NoBPTXbinning.xmin, HLTObjectsMonitor::MEbinning.xmin, cscdqm::AddressBox.xmin, TrackerMap.xmin, svgfig.Plot.xminiticks, svgfig.Frame.xminiticks, svgfig.Plot.xticks, svgfig.Frame.xticks, svgfig.Plot.ylabels, svgfig.Frame.ylabels, svgfig.Plot.ylogbase, svgfig.Frame.ylogbase, svgfig.Axes.ylogbase, svgfig.Plot.ymax, svgfig.Frame.ymax, svgfig.Axes.ymax, fftjetcms::LookupTable2d.ymin(), PixelClusterizerBase::AccretionCluster.ymin, dqmoffline::l1t::HistDefinition.ymin, Exhume::Event.ymin, cscdqm::AddressBox.ymin, TrackerMap.ymin, svgfig.Plot.yminiticks, svgfig.Frame.yminiticks, svgfig.Plot.yticks, and svgfig.Frame.yticks.

3092  def SVG(self, trans=None):
3093  """Apply the transformation "trans" and return an SVG object."""
3094  atx, aty = self.atx, self.aty
3095  if atx < self.xmin: atx = self.xmin
3096  if atx > self.xmax: atx = self.xmax
3097  if aty < self.ymin: aty = self.ymin
3098  if aty > self.ymax: aty = self.ymax
3099 
3100  xmargin = 0.1 * abs(self.ymin - self.ymax)
3101  xexclude = atx - xmargin, atx + xmargin
3102 
3103  ymargin = 0.1 * abs(self.xmin - self.xmax)
3104  yexclude = aty - ymargin, aty + ymargin
3105 
3106  if self.arrows != None and self.arrows != False:
3107  xarrow_start = self.arrows + ".xstart"
3108  xarrow_end = self.arrows + ".xend"
3109  yarrow_start = self.arrows + ".ystart"
3110  yarrow_end = self.arrows + ".yend"
3111  else:
3112  xarrow_start = xarrow_end = yarrow_start = yarrow_end = None
3113 
3114  xaxis = XAxis(self.xmin, self.xmax, aty, self.xticks, self.xminiticks, self.xlabels, self.xlogbase, xarrow_start, xarrow_end, exclude=xexclude, text_attr=self.text_attr, **self.attr).SVG(trans)
3115  yaxis = YAxis(self.ymin, self.ymax, atx, self.yticks, self.yminiticks, self.ylabels, self.ylogbase, yarrow_start, yarrow_end, exclude=yexclude, text_attr=self.text_attr, **self.attr).SVG(trans)
3116  return SVG("g", *(xaxis.sub + yaxis.sub))
3117 
def SVG(self, trans=None)
Definition: svgfig.py:3092
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

svgfig.Axes.arrows

Definition at line 3084 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Axes.attr
svgfig.Axes.aty

Definition at line 3081 of file svgfig.py.

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

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

Definition at line 3072 of file svgfig.py.

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

svgfig.Axes.text_attr

Definition at line 3086 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

dictionary svgfig.Axes.text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
static

Definition at line 3073 of file svgfig.py.

svgfig.Axes.xlogbase

Definition at line 3082 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Axes.xmax
svgfig.Axes.ylogbase

Definition at line 3083 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Axes.ymax