From J Wiki
Jump to navigation Jump to search

graph: graph package

gdopen opens a graphics window gd... set state gd... draw graphics gdshow show graphics glclose win| close window|active window glcloseall '' close all graphics windows glselect win select graphics window

points are plotted in a box with 1 1 at bottom left and 1 1 at top right.

verbs whose names end in '01' plot in a box with 0 0 at bottom left to 1 1 at top right. Conversion to the standard box is done automatically.

colors should be given as 3 numbers in range (0,255), or as a single RGB number.

state-setting functions:

  gdcolor      set color
  gdfont       set pen size and style
  gdpen        set pen size and style
  gdpencolor   set pen color
  gdtextcolor  set text color

drawing functions (each has a matching verb ending in '01' e.g. gdarc01):

  gdarc        draw arc
  gdchord      draw chord
  gdellipse    draw ellipse
  gdlines      draw lines
  gdpie        draw pie-shaped wedge
  gdpixel      draw pixel
  gdpolygon    draw polygon
  gdrect       draw rectangle
  gdroundr     draw rounded rectangle
  gdtext       draw text

other definitions:

 gdadd        add wrapper
 gdbmp        write graph to bmp file
 gdclip       write graph to clipboard (Windows only)
 gddraw       draw wrapper
 gdemf        write graph to emf file (Windows only)
 gdopen       open/clear graphics window
 gdselect     select graphics window
 gdshow       show graph

Name Type Description
gdarc verb draw arc
gdarc01 verb draw arc in 0 0 1 1
gdbmp verb write graph to bmp file
gdchord verb draw chord
gdchord01 verb draw chord in 0 0 1 1
gdclose verb close graphics window
gdcloseall verb close all graphics windows
gdcolor verb set color
gddraw verb wrapper for draw methods
gdellipse verb draw ellipse
gdellipse01 verb draw ellipse in 0 0 1 1
gdemf verb write graph to emf file
gdlines verb draw lines
gdlines01 verb draw lines in 0 0 1 1
gdopen verb open/clear graphics window
gdpen verb set pen size and style
gdpencolor verb set pen color
gdpie verb draw pie-shaped wedge
gdpie01 verb draw pie-shaped wedge in 0 0 1 1
gdpixel verb draw pixel
gdpixel01 verb draw pixel in 0 0 1 1
gdpolygon verb draw
gdpolygon01 verb draw in 0 0 1 1
gdrect verb draw rectangle
gdrect01 verb draw rectangle in 0 0 1 1
gdroundr verb rounded rectangle
gdroundr01 verb rounded rectangle in 0 0 1 1
gdselect verb select graphics window
gdshow verb show graphics