CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

svgfig::VGrid Class Reference

Inheritance diagram for svgfig::VGrid:
svgfig::Ticks

List of all members.

Public Member Functions

def __init__
def __repr__
def SVG

Public Attributes

 attr
 last_miniticks
 mini_attr
 ymax

Static Public Attributes

dictionary defaults = {"stroke-width":"0.25pt", "stroke":"gray"}
dictionary mini_defaults = {"stroke-width":"0.25pt", "stroke":"lightgray", "stroke-dasharray":"1,1"}

Detailed Description

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

HGrid(ymin, ymax, low, high, ticks, miniticks, logbase, mini_attr, attribute=value)

ymin, ymax              required        the y range
low, high               required        the x 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 3172 of file svgfig.py.


Constructor & Destructor Documentation

def svgfig::VGrid::__init__ (   self,
  ymin,
  ymax,
  low,
  high,
  ticks = -10,
  miniticks = False,
  logbase = None,
  mini_attr = {},
  attr 
)

Definition at line 3197 of file svgfig.py.

03197                                                                                                 {}, **attr):
03198     self.ymin, self.ymax = ymin, ymax
03199 
03200     self.mini_attr = dict(self.mini_defaults)
03201     self.mini_attr.update(mini_attr)
03202 
03203     Ticks.__init__(self, None, low, high, ticks, miniticks, None, logbase)
03204 
03205     self.attr = dict(self.defaults)
03206     self.attr.update(attr)
03207 

Member Function Documentation

def svgfig::VGrid::__repr__ (   self)

Reimplemented from svgfig::Ticks.

Definition at line 3194 of file svgfig.py.

03195                     :
03196     return "<VGrid y=(%g, %g) %g <= x <= %g ticks=%s miniticks=%s %s>" % (self.ymin, self.ymax, self.low, self.high, str(self.ticks), str(self.miniticks), self.attr)

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

Reimplemented from svgfig::Ticks.

Definition at line 3208 of file svgfig.py.

03209                            :
03210     """Apply the transformation "trans" and return an SVG object."""
03211     self.last_ticks, self.last_miniticks = Ticks.interpret(self)
03212 
03213     ticksd = []
03214     for t in self.last_ticks.keys():
03215       ticksd += Line(t, self.ymin, t, self.ymax).Path(trans).d
03216 
03217     miniticksd = []
03218     for t in self.last_miniticks:
03219       miniticksd += Line(t, self.ymin, t, self.ymax).Path(trans).d
03220 
03221     return SVG("g", Path(d=ticksd, **self.attr).SVG(), Path(d=miniticksd, **self.mini_attr).SVG())


Member Data Documentation

Reimplemented from svgfig::Ticks.

Definition at line 3197 of file svgfig.py.

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

Reimplemented from svgfig::Ticks.

Definition at line 3191 of file svgfig.py.

Reimplemented from svgfig::Ticks.

Definition at line 3208 of file svgfig.py.

Definition at line 3197 of file svgfig.py.

dictionary svgfig::VGrid::mini_defaults = {"stroke-width":"0.25pt", "stroke":"lightgray", "stroke-dasharray":"1,1"} [static]

Definition at line 3192 of file svgfig.py.

Definition at line 3197 of file svgfig.py.