Classes

References to class in modules in ./cls directory.

ColorBar

Function Parameter Type Remark (http://geography.uoregon.edu/datagraphics/color_scales.htm)
set(r, g, b, min, max, discrete=true, interoplate=0, digit=1, position=[0.85, 0.15, 0.02, 0.7])

r, g, b -- arrays
min, max -- numbers

Sets colorbar colors. min and max should be the range of contour levels.
get(v) number Returns color array for the contour level.
position(xoffset, yoffset, width, height) numbers Set colorbar position in the global coordinate system.
show(w=800, h=300) numbers Shows colorbar. Should be called after setting colors.
font(size=10, truetype="") number, string Set font type face and font size.
bl2do8(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
bl2do10(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
dc2br8(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
dc2br10(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
dc2br18(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
ds2br8(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
gr2mg16(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
bl2dr18(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
bl2gr14(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
br2bl12(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
bl2or14(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:
pair12(min, max, discrete=true) min, max -- numbers Sets colorbar colors to the preset colors:

Globe

Function Parameter Type Remark
size(width, height) numbers Sets image size.
add(shape, transform=true) user Adds a zeGraph object.
rotate(rotatex, rotatez) numbers Rotates the globe about global x-axis and the z-axis for the given degrees.
move(dx, dy) numbers move globe up-down or left-right.
view(lat, lon) numbers Views the globe from the given latitude-longitude.
save(fname) string Saves image to the file.
surface(iteration=5) number Creates globe surface. The iteration should be larger than 4 and less than 8. Returns a polygon object.
texture(fname) string Creates globe surface and uses the image in the file as texture.
grid(deg, width=1) number Draw latitude-longitude grid lines. Returns a node object.
gshhs(fname) string Reads coastline data from the GSHHS file and draw the lines. Returns a line object.
line(lon1, lat1, lon2, lat2) numbers Draws a line from (lon1,lat1) to (lon2,lat2) and return a line object.
text(x, y, string, size=12, halign=0, valign=-1) number, number, string Puts a text string at (x, y) in the global coordinate system and returns a text object. The text is horizontally centered if halign = 0, left aligned if halign < 0, right aligned if halign > 0, vertically centered if valign = 0, bottom aligned if valign < 0, and top aligned if valign > 0.
projection(lon, lat) numbers Returns x-y-z in an array as the projection results of the given longitude and latitude.
distance(lon1, lat1, lon2, lat2) numbers Returns the distance between (lon1,lat1) and (lon2,lat2) on a unit globe surface.
save(fname) string Saves image to the file.
show()   Displays the globe. It should be called after setting the globe surface and grid
animate()   Displays the globe and allows controlling rotation by arrow keys and mouse.

Plot2d

Function Parameter Type Remark
size(width, height) numbers Sets image size.
add(shape, transform=true, anchor=null) shape -- user Adds a zeGraph object to plot.
font(size=10, truetype="") number, string Set font type face and font size.
scale(xscal, yscale) numbers Resizes the plot.
move(dx, dy) numbers Moves the plot off the global view center.
xaxis(title="X", range=[-1,1], bottom=true, tickmarks=[-1,.5,0], tickdigits=1)   Customizes x-axis.
yaxis(title="Y", range=[-1,1], left=true, tickmarks=[-1,.5,0], tickdigits=1)   Customizes y-axis.
line(x, y, smooth=false) arrays or matrixes Plots a line and returns the object.
polygon(x, y, fill=false) arrays or matrixes Plots a polygon and returns the object.
frame(width=1.5)   Plots a frame around axises.
point(x, y, size=1, smooth=false) arrays or matrixes Plots points and returns the object.
symbol(x, y, symbol) numbers, arrays, or matrixes Puts the symbol at given positions.
bar(x, dx, y) dx -- number
x, y -- numbers, arrays, or matrixes
Pots bars and returns a polygon object.
text(x, y, string, size=12, halign=0, valign=-1) x, y -- numbers
string -- string
Puts a text string at (x, y) and returns a text object. The text is horizontally centered if halign = 0, left aligned if halign < 0, right aligned if halign > 0, vertically centered if valign = 0, bottom aligned if valign < 0, and top aligned if valign > 0.
image(p1, p2, p3, p4, fname) array, array, array, string Puts the image in filename in a rectangle determined by points of p1(x,y), p2(x,y), p3(x,y), and p4(x,y).
gshhs(fname) string Reads coastline data from the GSHHS file and draw the lines. Returns a line object.
arrow(x, y, u, uscale, v, vscale, size=5, smooth=false) numbers Plots an arrow that starts at (x, y) and points toward (u, v) like a wind vector, and returns a line object. The size parameter determines arrow head size in pixel.
save(fname) string Saves image to the file.
show()   Displays the plot.
animate()   Displays the plot and allows controlling rotation by arrow keys and mouse.

Plot3d

Function Parameter Type Remark
size(width, height) numbers Sets image size.
add(shape, transform=true, anchor=null) shape -- user Adds a zeGraph object to plot.
font(size=10, truetype="") number, string Set font type face and font size.
scale(xscal, yscale, zscale) numbers Resizes the plot.
move(dx, dy) numbers Moves the plot off the global view center.
rotate(rotatex, rotatez) numbers Rotates the plot.
xaxis(title="X", range=[-1,1], anchor=[0,-1,-1], tickmarks=[-1,.5,0], tickdigits=1)   Customizes x-axis.
yaxis(title="Y", range=[-1,1], anchor=[-1,0,-1], tickmarks=[-1,.5,0], tickdigits=1)   Customizes y-axis.
zaxis(title="Z", range=[-1,1], anchor=[-1,1,0], tickmarks=[-1,.5,0], tickdigits=1)   Customizes z-axis.
line(x, y, z) arrays or matrixes Plots a line and returns the object.
polygon(x, y, z, fill=false) arrays or matrixes Plots a polygon and returns the object.
point(x, y, z, size=1) arrays or matrixes Plots points and returns the object.
symbol(x, y, z, symbol) numbers, arrays, or matrixes Puts the symbol at given positions.
text(x, y, z, string, size=12, halign=0, valign=-1) x, y, z-- numbers
string -- string
Puts a text string at (x, y, z) and returns a text object. The text is horizontally centered if halign = 0, left aligned if halign < 0, right aligned if halign > 0, vertically centered if valign = 0, bottom aligned if valign < 0, and top aligned if valign > 0.
image(p1, p2, p3, p4, fname) array, array, array, string Puts the image in filename in a rectangle determined by points of p1(x,y,z), p2(x,y,z), p3(x,y,z), and p4(x,y,z).
gshhs(fname, z=c_zmin) string Reads coastline data from the GSHHS file and draw the lines on the x-y plane. Returns a line object.
save(fname) string Saves image to the file.
show()   Displays the plot.
animate()   Displays the plot and allows controlling rotation by arrow keys and mouse.

Shapes2d

Function Parameter Type Remark
plus(size=5) number Returns a line object for drawing a plus symbol.
cross(size=5) number Returns a line object for drawing a cross symbol.
triangle(size=5) number Returns a polygon object for drawing a filled triangle symbol. You can set the fill mode to -1 to draw only the outline.
square(size=5) number Returns a polygon object for drawing a filled square symbol. You can set the fill mode to -1 to draw only the outline.
diamond(size=5) number Returns a polygon object for drawing a filled diamond symbol. You can set the fill mode to -1 to draw only the outline.
circl(size=5) number Returns a line object for drawing a circle symbol.
pie(size=5) number Returns a polygon object for drawing a filled circle symbol.

shapes3d

Function Parameter Type Remark
disk(n, r) numbers Returns a polygon object for drawing a disk on x-y plane with normal pointing to z. The slice number n determines the fineness, and the radius r determines the size.
cylinder(n, r, h) numbers Returns a polygon object for drawing a cylinder on x-y plane with height h along z-axis. The slice number n determines the fineness, and the radius r determines the size.
cone(n, r, h) numbers Returns a polygon object for drawing a cone on x-y plane with height h along z-axis. The slice number n determines the fineness, and the radius r determines the size.
sphere(n, r) numbers Returns a polygon object for drawing a sphere. The iteration number n (1 to 8) determines the fineness, and the radius r determines the size.