CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, xmin, xmax, ymin, ymax, 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 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)
 

Public Attributes

 attr
 
 high
 
 last_xminiticks
 
 last_yminiticks
 
 mini_attr
 
 xmax
 
 ymax
 
- 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 a grid over a specified region using the standard tick
specification (see help(Ticks)) to place the grid lines.

Grid(xmin, xmax, ymin, ymax, ticks, miniticks, logbase, mini_attr, attribute=value)

xmin, xmax              required        the x range
ymin, ymax              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 3221 of file svgfig.py.

Constructor & Destructor Documentation

◆ __init__()

def svgfig.Grid.__init__ (   self,
  xmin,
  xmax,
  ymin,
  ymax,
  ticks = -10,
  miniticks = False,
  logbase = None,
  mini_attr = {},
**  attr 
)

Definition at line 3245 of file svgfig.py.

3245  def __init__(self, xmin, xmax, ymin, ymax, ticks=-10, miniticks=False, logbase=None, mini_attr={}, **attr):
3246  self.xmin, self.xmax = xmin, xmax
3247  self.ymin, self.ymax = ymin, ymax
3248 
3249  self.mini_attr = dict(self.mini_defaults)
3250  self.mini_attr.update(mini_attr)
3251 
3252  Ticks.__init__(self, None, None, None, ticks, miniticks, None, logbase)
3253 
3254  self.attr = dict(self.defaults)
3255  self.attr.update(attr)
3256 

Member Function Documentation

◆ __repr__()

def svgfig.Grid.__repr__ (   self)

Reimplemented from svgfig.Ticks.

Definition at line 3242 of file svgfig.py.

3242  def __repr__(self):
3243  return "<Grid x=(%g, %g) y=(%g, %g) ticks=%s miniticks=%s %s>" % (self.xmin, self.xmax, self.ymin, self.ymax, str(self.ticks), str(self.miniticks), self.attr)
3244 

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.Ticks.miniticks, str, svgfig.Ticks.ticks, svgfig.Axes.xmax, svgfig.HGrid.xmax, svgfig.Grid.xmax, fftjetcms::LookupTable2d.xmin(), TriggerDQMBase::MEbinning.xmin, AbsHcalFunctor.xmin(), MEbinning.xmin, PixelClusterizerBase::AccretionCluster.xmin, HcalLinearCompositionFunctor.xmin(), MEPSet.xmin, HcalChebyshevFunctor.xmin(), HcalCubicInterpolator.xmin(), HcalInterpolatedTableFunctor.xmin(), HcalPolynomialFunctor.xmin(), BremsstrahlungSimulator.xmin, ClusterizingHistogram.xmin, HcalPiecewiseLinearFunctor.xmin(), MTDClusterizerBase::AccretionCluster.xmin, SummationStep.xmin, MuonBremsstrahlungSimulator.xmin, GammaFunctionGenerator.xmin, BaseNumericalRandomGenerator.xmin, fftjetcms::LinInterpolatedTable1D.xmin(), dqmoffline::l1t::HistDefinition.xmin, cscdqm::AddressBox.xmin, HLTObjectsMonitor::MEbinning.xmin, TrackerMap.xmin, svgfig.Plot.ymax, svgfig.Frame.ymax, svgfig.Axes.ymax, svgfig.VGrid.ymax, svgfig.Grid.ymax, fftjetcms::LookupTable2d.ymin(), PixelClusterizerBase::AccretionCluster.ymin, MTDClusterizerBase::AccretionCluster.ymin, dqmoffline::l1t::HistDefinition.ymin, Exhume::Event.ymin, cscdqm::AddressBox.ymin, and TrackerMap.ymin.

Referenced by data_sources.json_file.__str__().

◆ SVG()

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

Reimplemented from svgfig.Ticks.

Definition at line 3257 of file svgfig.py.

3257  def SVG(self, trans=None):
3258  """Apply the transformation "trans" and return an SVG object."""
3259  self.low, self.high = self.xmin, self.xmax
3260  self.last_xticks, self.last_xminiticks = Ticks.interpret(self)
3261  self.low, self.high = self.ymin, self.ymax
3262  self.last_yticks, self.last_yminiticks = Ticks.interpret(self)
3263 
3264  ticksd = []
3265  for t in self.last_xticks.keys():
3266  ticksd += Line(t, self.ymin, t, self.ymax).Path(trans).d
3267  for t in self.last_yticks.keys():
3268  ticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d
3269 
3270  miniticksd = []
3271  for t in self.last_xminiticks:
3272  miniticksd += Line(t, self.ymin, t, self.ymax).Path(trans).d
3273  for t in self.last_yminiticks:
3274  miniticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d
3275 
3276  return SVG("g", Path(d=ticksd, **self.attr).SVG(), Path(d=miniticksd, **self.mini_attr).SVG())
3277 

Member Data Documentation

◆ attr

svgfig.Grid.attr

Definition at line 3254 of file svgfig.py.

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

◆ defaults

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

Definition at line 3239 of file svgfig.py.

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

◆ high

svgfig.Grid.high

Definition at line 3259 of file svgfig.py.

◆ last_xminiticks

svgfig.Grid.last_xminiticks

Definition at line 3260 of file svgfig.py.

◆ last_yminiticks

svgfig.Grid.last_yminiticks

Definition at line 3262 of file svgfig.py.

◆ mini_attr

svgfig.Grid.mini_attr

Definition at line 3249 of file svgfig.py.

◆ mini_defaults

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

Definition at line 3240 of file svgfig.py.

◆ xmax

svgfig.Grid.xmax

Definition at line 3246 of file svgfig.py.

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

◆ ymax

svgfig.Grid.ymax

Definition at line 3247 of file svgfig.py.

Referenced by svgfig.YAxis.__repr__(), and svgfig.Grid.__repr__().

relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
str
#define str(s)
Definition: TestProcessor.cc:48
Line
Definition: Line.h:10
mps_fire.Path
Path
Definition: mps_fire.py:290
update
#define update(a, b)
Definition: TrackClassifier.cc:10