What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Jun 17, 2008 by jpivarski
Labels: Reference, Version1
ClassPlot  
A Fig with a coordinate axis

(This page applies only to the 1.x branch of SVGFig.)

class Plot

Acts like Fig, but draws a coordinate axis. You also need to supply plot ranges.

Arguments

Plot(xmin, xmax, ymin, ymax, obj, obj, obj..., keyword options...)

xmin, xmax required minimum and maximum x values (in the objs' coordinates)
ymin, ymax required minimum and maximum y values (in the objs' coordinates)
obj optional list drawing primatives
keyword options keyword list options defined below

The drawing primatives must implement the SVG method, as described in the Fig documentation.

Unlike Fig, Plot has an implicit coordinate transformation: from (xmin, xmax), (ymin, ymax) to its bounding box. This coordinate transformation (a window transformation) flips the direction of the y axis (SVG coordinates have y increasing downward, local Plot coordinates have y increasing upward).

Any additional coordinate transformation, given through the "trans" keyword option (or given as an argument to the SVG method) is composed with Plot's implicit window transformation.

The following are keyword options, with their default values:

trans None transformation function
x, y 5, 5 upper-left corner of the Plot in SVG coordinates
width, height 90, 90 width and height of the Plot in SVG coordinates
flipx, flipy False, True flip the sign of the coordinate axis
minusInfinity -1000 if an axis is logarithmic and an object is plotted at 0 or a negative value, -1000 will be used as a stand-in for NaN
atx, aty 0, 0 the place where the coordinate axes cross
xticks -10 request ticks according to the standard tick specification
xminiticks True request miniticks according to the standard minitick specification
xlabels True request tick labels according to the standard tick label specification
xlogbase None if a number, the axis and transformation are logarithmic with ticks at the given base (10 being the most common)
same for y
arrows None if a new identifier, create arrow markers and draw them at the ends of the coordinate axes
text_attr {} a dictionary of attributes for label text
axis_attr {} a dictionary of attributes for the axis lines

Member data

These data may be changed at any time. You do not need to make a list of all graphics before creating a Plot; you can create an empty Plot and append items to its d member.

d list of plottable objects
all keyword options same meaning as above

SVG method

Just like Fig, Plot has an SVG method to convert its objects into SVG.

All graphics primatives must supply a SVG method with the same arguments.


Sign in to add a comment