Public Member Functions | |
def | __init__ |
def | __repr__ |
def | SVG |
Public Attributes | |
attr | |
high | |
last_xminiticks | |
last_yminiticks | |
mini_attr | |
xmax | |
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"} |
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
def svgfig::Grid::__init__ | ( | self, | |
xmin, | |||
xmax, | |||
ymin, | |||
ymax, | |||
ticks = -10 , |
|||
miniticks = False , |
|||
logbase = None , |
|||
mini_attr = {} , |
|||
attr | |||
) |
Definition at line 3246 of file svgfig.py.
03246 {}, **attr): 03247 self.xmin, self.xmax = xmin, xmax 03248 self.ymin, self.ymax = ymin, ymax 03249 03250 self.mini_attr = dict(self.mini_defaults) 03251 self.mini_attr.update(mini_attr) 03252 03253 Ticks.__init__(self, None, None, None, ticks, miniticks, None, logbase) 03254 03255 self.attr = dict(self.defaults) 03256 self.attr.update(attr) 03257
def svgfig::Grid::__repr__ | ( | self | ) |
Reimplemented from svgfig::Ticks.
def svgfig::Grid::SVG | ( | self, | |
trans = None |
|||
) |
Apply the transformation "trans" and return an SVG object.
Reimplemented from svgfig::Ticks.
Definition at line 3258 of file svgfig.py.
03259 : 03260 """Apply the transformation "trans" and return an SVG object.""" 03261 self.low, self.high = self.xmin, self.xmax 03262 self.last_xticks, self.last_xminiticks = Ticks.interpret(self) 03263 self.low, self.high = self.ymin, self.ymax 03264 self.last_yticks, self.last_yminiticks = Ticks.interpret(self) 03265 03266 ticksd = [] 03267 for t in self.last_xticks.keys(): 03268 ticksd += Line(t, self.ymin, t, self.ymax).Path(trans).d 03269 for t in self.last_yticks.keys(): 03270 ticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d 03271 03272 miniticksd = [] 03273 for t in self.last_xminiticks: 03274 miniticksd += Line(t, self.ymin, t, self.ymax).Path(trans).d 03275 for t in self.last_yminiticks: 03276 miniticksd += Line(self.xmin, t, self.xmax, t).Path(trans).d 03277 03278 return SVG("g", Path(d=ticksd, **self.attr).SVG(), Path(d=miniticksd, **self.mini_attr).SVG())
Reimplemented from svgfig::Ticks.
dictionary svgfig::Grid::defaults = {"stroke-width":"0.25pt", "stroke":"gray"} [static] |
Reimplemented from svgfig::Ticks.
Reimplemented from svgfig::Ticks.
dictionary svgfig::Grid::mini_defaults = {"stroke-width":"0.25pt", "stroke":"lightgray", "stroke-dasharray":"1,1"} [static] |