CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

svgfig::HGrid Class Reference

Inheritance diagram for svgfig::HGrid:
svgfig::Ticks

List of all members.

Public Member Functions

def __init__
def __repr__
def SVG

Public Attributes

 attr
 last_miniticks
 mini_attr
 xmax

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 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.

03147                                                                                                 {}, **attr):
03148     self.xmin, self.xmax = xmin, xmax
03149 
03150     self.mini_attr = dict(self.mini_defaults)
03151     self.mini_attr.update(mini_attr)
03152 
03153     Ticks.__init__(self, None, low, high, ticks, miniticks, None, logbase)
03154 
03155     self.attr = dict(self.defaults)
03156     self.attr.update(attr)
03157 

Member Function Documentation

def svgfig::HGrid::__repr__ (   self)

Reimplemented from svgfig::Ticks.

Definition at line 3144 of file svgfig.py.

03145                     :
03146     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)

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

Reimplemented from svgfig::Ticks.

Definition at line 3158 of file svgfig.py.

03159                            :
03160     """Apply the transformation "trans" and return an SVG object."""
03161     self.last_ticks, self.last_miniticks = Ticks.interpret(self)
03162 
03163     ticksd = []
03164     for t in self.last_ticks.keys():
03165       ticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d
03166 
03167     miniticksd = []
03168     for t in self.last_miniticks:
03169       miniticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d
03170 
03171     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 3147 of file svgfig.py.

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

Reimplemented from svgfig::Ticks.

Definition at line 3141 of file svgfig.py.

Reimplemented from svgfig::Ticks.

Definition at line 3158 of file svgfig.py.

Definition at line 3147 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.

Definition at line 3147 of file svgfig.py.