CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.HGrid Class Reference
Inheritance diagram for svgfig.HGrid:
svgfig.Ticks

Public Member Functions

def __init__ (self, xmin, xmax, low, high, ticks=-10, miniticks=False, logbase=None, mini_attr={}, attr)
 
def __repr__ (self)
 
def SVG (self, trans=None)
 
- Public Member Functions inherited from svgfig.Ticks
def __init__ (self, f, low, high, ticks=-10, miniticks=True, labels=True, logbase=None, arrow_start=None, arrow_end=None, text_attr={}, attr)
 
def __repr__ (self)
 
def compute_logminiticks (self, base)
 
def compute_logticks (self, base, N, format)
 
def compute_miniticks (self, original_ticks)
 
def compute_ticks (self, N, format)
 
def interpret (self)
 
def orient_tickmark (self, t, trans=None)
 
def regular_miniticks (self, N)
 
def SVG (self, trans=None)
 

Public Attributes

 attr
 
 last_miniticks
 
 mini_attr
 
 xmax
 
- Public Attributes inherited from svgfig.Ticks
 arrow_end
 
 arrow_start
 
 attr
 
 f
 
 high
 
 labels
 
 last_miniticks
 
 logbase
 
 low
 
 miniticks
 
 text_attr
 
 ticks
 

Static Public Attributes

dictionary defaults = {"stroke-width":"0.25pt", "stroke":"gray"}
 
dictionary mini_defaults = {"stroke-width":"0.25pt", "stroke":"lightgray", "stroke-dasharray":"1,1"}
 
- Static Public Attributes inherited from svgfig.Ticks
dictionary defaults = {"stroke-width":"0.25pt"}
 
float minitick_end = 0.75
 
float minitick_start = -0.75
 
int text_angle = 0
 
dictionary text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
 
float text_start = 2.5
 
float tick_end = 1.5
 
float tick_start = -1.5
 

Detailed Description

Draws the horizontal lines of a grid over a specified region
using the standard tick specification (see help(Ticks)) to place the
grid lines.

HGrid(xmin, xmax, low, high, ticks, miniticks, logbase, mini_attr, attribute=value)

xmin, xmax              required        the x range
low, high               required        the y range
ticks                   default=-10     request ticks according to the standard
                                        tick specification (see help(Ticks))
miniticks               default=False   request miniticks according to the
                                        standard minitick specification
logbase                 default=None    if a number, the axis is logarithmic
                                        with ticks at the given base (usually 10)
mini_attr               default={}      SVG attributes for the minitick-lines
                                        (if miniticks != False)
attribute=value pairs   keyword list    SVG attributes for the major tick lines

Definition at line 3122 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.HGrid.__init__ (   self,
  xmin,
  xmax,
  low,
  high,
  ticks = -10,
  miniticks = False,
  logbase = None,
  mini_attr = {},
  attr 
)

Definition at line 3147 of file svgfig.py.

3147  def __init__(self, xmin, xmax, low, high, ticks=-10, miniticks=False, logbase=None, mini_attr={}, **attr):
3148  self.xmin, self.xmax = xmin, xmax
3149 
3151  self.mini_attr.update(mini_attr)
3152 
3153  Ticks.__init__(self, None, low, high, ticks, miniticks, None, logbase)
3154 
3155  self.attr = dict(self.defaults)
3156  self.attr.update(attr)
3157 
dictionary mini_defaults
Definition: svgfig.py:3142
def __init__(self, xmin, xmax, low, high, ticks=-10, miniticks=False, logbase=None, mini_attr={}, attr)
Definition: svgfig.py:3147
dictionary defaults
Definition: svgfig.py:2379

Member Function Documentation

def svgfig.HGrid.__repr__ (   self)

Definition at line 3144 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.Curve.high, svgfig.Line.high, svgfig.Rect.high, svgfig.Ellipse.high, svgfig.Ticks.high, svgfig.Curve.low, svgfig.Line.low, svgfig.Rect.low, svgfig.Ellipse.low, svgfig.Ticks.low, svgfig.Ticks.miniticks, harvestTrackValidationPlots.str, svgfig.Ticks.ticks, svgfig.Axes.xmax, svgfig.HGrid.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, BaseNumericalRandomGenerator.xmin, dqmoffline::l1t::HistDefinition.xmin, NoBPTXMonitor::NoBPTXbinning.xmin, HLTObjectsMonitor::MEbinning.xmin, cscdqm::AddressBox.xmin, and TrackerMap.xmin.

Referenced by data_sources.json_file.__str__().

3144  def __repr__(self):
3145  return "<HGrid x=(%g, %g) %g <= y <= %g ticks=%s miniticks=%s %s>" % (self.xmin, self.xmax, self.low, self.high, str(self.ticks), str(self.miniticks), self.attr)
3146 
def __repr__(self)
Definition: svgfig.py:3144
def svgfig.HGrid.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 3158 of file svgfig.py.

3158  def SVG(self, trans=None):
3159  """Apply the transformation "trans" and return an SVG object."""
3160  self.last_ticks, self.last_miniticks = Ticks.interpret(self)
3161 
3162  ticksd = []
3163  for t in self.last_ticks.keys():
3164  ticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d
3165 
3166  miniticksd = []
3167  for t in self.last_miniticks:
3168  miniticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d
3169 
3170  return SVG("g", Path(d=ticksd, **self.attr).SVG(), Path(d=miniticksd, **self.mini_attr).SVG())
3171 
def SVG(self, trans=None)
Definition: svgfig.py:3158

Member Data Documentation

svgfig.HGrid.attr

Definition at line 3155 of file svgfig.py.

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

dictionary svgfig.HGrid.defaults = {"stroke-width":"0.25pt", "stroke":"gray"}
static

Definition at line 3141 of file svgfig.py.

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

svgfig.HGrid.last_miniticks

Definition at line 3160 of file svgfig.py.

svgfig.HGrid.mini_attr

Definition at line 3150 of file svgfig.py.

dictionary svgfig.HGrid.mini_defaults = {"stroke-width":"0.25pt", "stroke":"lightgray", "stroke-dasharray":"1,1"}
static

Definition at line 3142 of file svgfig.py.

svgfig.HGrid.xmax

Definition at line 3148 of file svgfig.py.

Referenced by svgfig.XAxis.__repr__(), svgfig.HGrid.__repr__(), and svgfig.Grid.__repr__().