Revision 1 as of 2007-05-11 05:43:13
converted to 1.6 markup
|Deletions are marked like this.||Additions are marked like this.|
|Line 3:||Line 3:|
|Line 13:||Line 13:|
|Drawing takes place in the current plot's Graf Box, Gxywh, see [:Plot/Layout:Layout].||Drawing takes place in the current plot's Graf Box, Gxywh, see [[Plot/Layout|Layout]].|
|Line 61:||Line 61:|
This is a work in progress and is intended for the J602 release. It is currently available in the J601 script library from build 31.
New plot commands support direct use of drawing commands within a pd command sequence. The main benefit of doing this within Plot instead of direct to the isigraph control after a Plot is drawn, is that the drawing is positioned in the Plot graphics subwindow, and the commands can be run before the data is drawn.
The new commands are named gdxxx, and are cover functions for the corresponding glxxx commands, much like the Graph package, e.g. gdpencolor 255 0 0 sets the pen color to red.
By default, drawing takes place after the axes are drawn, and before the data is plotted. The command gdend sets subsequent gdxxx commands to be drawn after the data is plotted.
Drawing takes place in the current plot's Graf Box, Gxywh, see Layout.
All positions are set with absolute positions xy, rather than positions plus width and height. For example, a rectangle is specfied as x0,y0,x1,y1 rather than as x,y,w,h.
An xy of 0 0 is the bottom left corner, i.e. Gx,Gy. This corresponds to the positioning in plot, whereas gl2 commands normally start at the top left.
Each position can be given in one of three ways, that can be mixed together:
1. an ordinary number is a value between 0 and 1000 inclusive, where 0 is the bottom/left and 1000 is the top/right of the Graf Box, e.g. 500,1000 is halfway along the x axis, at the top.
2. a number with an r suffix is an axis position, e.g. 2r,3r corresponds to position 2 on the x-axis, 3 on the y-axis. (Note, positioning to a second y axis is not yet supported).
3. a number with an x suffix is in pixels. A negative position counts from the end, offset by 1, so that -101x -201x -1x -1x is the 100 x 200 pixels at the top right corner.
Only a few commands are currently implemented.
set brush color - same as glrgb followed by glbrush
set subsequent commands to be drawn after the data
set pen as size [,style] - same as glpen
set pen color - same as glrgb followed by glpen
draw lines - same as gllines
draw rectangle - same as glrect, except specified as x0,y0,x1,y1
pd 'type bar' pd 'barwidth 0.4' pd 'color 128 192 255' pd 'gdpen 2 0' pd 'gdlines 0 4r 1000 4r' pd 'gdend' pd 'gdpen 5 0;gdpencolor 255 0 0' pd 'gdlines 0 0 1000 800' pd 'gdpen 1 0;gdpencolor 0 0 0;gdbrushcolor 0 128 0' pd 'gdrect 0 0 2r 1r' pd 5 2 7 3 pd 'show'