Addons/graphics/graph
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
Also: points are plotted to pixels in a box with coordinates (0,0) at top left points should be given as a 2 element vector or 2 column matrix colors should be given as 3 numbers in range (0,255) for RGB, or as a single RGB number.
cile x cile values of y example: 3 cile i.12
fitrect01 fit rectangle data to 0 1 form: [anisotropic] fitrect01 data if left argument is 1, applies same factors to both columns otherwise, scales columns independently.
fit01 fit data to range 0 1 form: [anisotropic] fit data if left argument is 1, scales columns independently, otherwise applies same factors to all data,
grayscale generate grayscale example: grayscale (i.%<:) 5
hue generate color from color set x is color set y is values from 0 to 1, selecting color
hueRGB generate color from RGB color se x is RGB color set (default HUES) y is values from 0 to 1, selecting color
polygon vertices of a regular polygon y = number of points x = scale factor on angle 2p1%y (default 1) e.g. polygon 5 = pentagon 2 polygon 5 = 5 pointed star
rotate rotate angle by given amount e.g. 0.5p1 rotate points = rotate clockwise a quarter turn |