| 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

zeColorBar

Use .new("colorbar") to create the object. If the width is larger than the height, the bar is drawn horizontally; otherwise vertically.

:add(value, red, green, blue)

Adds the color for the value to the color table.

:add{value, red, green, blue, ...}

Adds the colors for data values using Lua table.

:font(obj)

Uses the font object for generating text.

:fontsize(size)

Sets the font size.

:get(value)

Returns red, green, blue of the color that represent the value.

:set{...}

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

Key Value Type Remark
color {r, g, b} Numbers (0 to 1) in table Sets the object's line and label color in red, green, and blue.
interpolation n Number (>0) Insert n-number of colors between current colors by linear interpolation
poisition {xoffset, yoffset, width, height} Numbers in table Sets the colorbar position, which refers to the global coordinate system.
numberformat {digit, scientific} Number and Boolean in table Sets number format, i.e, the number of digits and whether to use scientific notation.
gradient flag Boolean Specifies gradient or discrete types of color bar.
enable flag Boolean Enables (default) and disables the object
labels {v0, delta, n} Numbers in table Sets the number of colorbar labels to n. The first label for value v0, the second for v0+delta, and so on.