| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Graph
   axis
   blend
   color
   color bar
   fog
   freetype
   light
   line
   material
   node
   point
   plot
   polygon
   render
   scene
   stencil
   texcoord
   text
   texture
   vertex
Utility
   array
   bio
   hdf
   make
   math
   netcdf
Auxiliary
   curl
   expact
   sqlite
   window

zePlot

Use .new("plot") to create the object. It redefines coordinates for objects it contains. The z-axis is disabled by default. However, any call the set() function with axis="z" will enable the axis. An array used as as a function argument must be double type.

:add(object[, object, ...])

Adds any number of objects to the plot.

:add(object, x, y, z)

Adds an object to the node and position it at x, y, and z in the plot coordinate system. If the object is zeText, it will neither be scaled nor rotated by the plot. Any other type of obejcts will be rotated but not scaled by the plot.

:font(object)

Sets the Freetype object to be used to generate text.

:fontsize(size)

Sets font size of axes. The function must be called before setting the axis and tick labels.

:rotate(az, ax)

The function rotates the object first around the z-axis and then around the x-axis.

:scale(xs, ys, zs)

Scales all objects in the plot in x, y, and z direction for the factors of xs, ys, and zs.

:toglobal(w, h, x, y, z)

Converts x, y, and z in the plot coordinate system to those in the global coordinate system. Parameters w and h are the view port width and height respectively.

:toglobal(w, h, arr)

Converts x, y, and z in the first three vectors of the array from plot coordinates to global coordinates. Parameters w and h are the view port width and height respectively.

:toplot(w, h, x, y, z)

Converts x, y, and z in the global coordinate system to those in the plot coordinate system. Parameters w and h are the view port width and height respectively.

:toplot(w, h, arr)

Converts x, y, and z in the first three vectors of the array from global coordinates to plot coordinates. Parameters w and h are the view port width and height respectively.

:set{...}

Sets axis properties of the plot with a Lua table. Valid key-value pairs in the Lua table are listed as follows.

Key Value Type Remark
axis x, y, or z string Specifies setting properties of the x-, y-, or z-axis. Each call to set() function must contain this key-value pair.
color {r, g, b, a} Numbers (0 to 1) in table Sets axis color components of read, green, blue, and alpha.
label name string Sets axis label.
linewidth width Number (>0) Set axis and tick line width.
offset {xoff, yoff, zoff} Numbers in table Sets axis offset from the center.
anchor {xf, yf, zf} Numbers in table Anchors an axis object in the global coordinate system. Values of the x-, y-, and z-factors should be -1, 0, or 1. Zero mean no change along that axis; 1 means to the positive end of that axis; and -1 means to the negative end of that axis.
range {min, max} Numbers in table Sets the minimum and maximum that the axis represents.
ticklenth scale Number (>0) Scales the tick length.
ticklabels {names, center} String and Boolean in table. Customizes tick labels. individual labels are separated by character |, e.g., "|1991|1992|1993|1994|". If center is true, labels will be positioned between major ticks.
tickdigit {digit, scientific} Number and Boolean in table Sets tick number format, i.e, the number of digits and whether to use scientific notation.
tickmarks {start, step, minor} Numbers in table Sets tick marks, i.e., the start of the first major tick, the step, and the number of minor ticks between major ticks.
smooth flag Boolean Renders smooth (antialias) lines. Blending should be used in the scene for this to work.
showlabels flag Boolean Shows or hides labels
showticks flag Boolean Shows or hides ticks. This will affect labels as well.
enable flag Boolean Enables or disables the object.