Crude 3-dimensional graphics (STB-12: gr3.1) ---------------------------- ^gr3^ [xvar yvar zvar [^if^ exp] [^in^ range]] [^,^ options] ^restore^ options are: (default) ^ap^en^(^#^)^ pen for axis ^3^ ^dp^en^(^#^)^ pen for data ^2^ ^lp^en^(^#^)^ pen for lines ^1^ ^tp^en^(^#^)^ pen for text ^3^ ^sp^en^(^#^)^ pen for shadow ^3^ ^ps^ize^(^#^)^ size of text ^115^ ^r^ot^(^#^)^ rotation angle ^45^ or as set by ^gr3set^ ^e^lev^(^#^)^ elevation angle ^45^ or as set by ^gr3set^ ^s^ymbol^(^s^)^ see help graph ^o^ ^c^onnect^(^l^)^ see help graph ^.^ + other ^graph^ options Introduction ------------ ^gr3^ draws (crude) 3-dimensional scatterplots. To graph the variables ^price^, ^weight^, and ^mpg^, for instance: . ^gr3 price weight mpg^ (graph is displayed) Once a graph has been drawn, you can redisplay the graph by typing ^gr3^ by itself: . ^gr3^ (graph is redisplayed) You can specify options at the first or second step, so if you liked the graph: . ^gr3, saving(mygph)^ (graph is redisplayed and saved) Or, . ^gr3, rot(45) elev(45)^ (graph is displayed at different projection angles.) Introduction, continued ----------------------- Options can be specified either when you originally draw the graph or when you redraw it. ^gr3^ modifies the data in memory, but it saved your original data, so you can get it back by typing: . ^restore^ Then ^gr3^ without arguments cannot redisplay your graph. You have to start over again. Thus, you first draw a graph using ^gr3^ followed by a varlist, you optionally redisplay the graph, varying the options using ^gr3^ without a varlist, and finally, you ^restore^ your original data. (Options are explained on the next page.) Options: projection -------------------- The most important options are ^rotate()^ and ^elev()^, typically abbreviated ^r()^ and ^e()^. These are the angles at which the graph is projected onto your two-dimensional screen. You should try different values since the structure of your data may be better revealed by one angle rather than another. Angles are specified in degrees. Good choices are: Resolution of ^rotation()^ ^elev()^ x y z ----------------------------------------------------------- ^30^ ^60^ good good adequate ^45^ ^45^ adequate adequate adequate ^60^ ^30^ poor poor excellent (Options are continued on the next page) Options: pens (colors) ----------------------- The 3-d graph consists of an axis, the data, lines drawn from the data to the x-y plane, and text. The pens (colors) used for each are selected by the ^apen()^, ^dpen()^, ^lpen()^, and ^tpen()^ options. If you do not specify, the de- faults are: axis pen 3 (white) data pen 2 (yellow) lines pen 1 (dim cyan) text pen 3 (white) ^gr3^ has a second graph style, called shadow mode. Graphs are drawn in shadow mode if you have ^gr3set shadow on^ (see ^help gr3set^). In shadow mode, a graph consists of an axis, the data, shadows, and text. That is, the shadows are substituted for the lines drawn from the data to the x-y plane. The default pen (color) for the shadow is pen 3 (white), but you may change this with the ^spen()^ option. (Options are continued on the next page) Options: symbols, connection, etc. ----------------------------------- The ^symbol()^ option works just as it does with ^graph^. The default is ^symbol(o)^. You may specify any symbol either when you originally draw the graph or when you redraw it. You may also specify text symbols (e.g., ^symbol([brand])^), but the option must be specified when you originally draw the graph. Once the graph is drawn, you may redraw it using any symbol or the text symbol. The ^connect()^ option, along with the other ^graph^ options exclusive of labeling but including titling, work just as they do with ^graph^. (Graph styles are explained on the next page) Graph styles ------------ We alluded to a second graph style, called shadowing. ^gr3^ provides two styles, the default, in which it draws lines from the data to the x-y plane, and ^gr3set shadow on^, which draws in shadows on two of the planes rather than the lines. Using ^gr3set^ to change the mode does not have any effect on an already-drawn graph. It will affect the next graph you draw using raw data, however. ^gr3^ also provides different axis styles. These, too, are set using ^gr3set^ and, like shadow, do not affect an already existing graph. See ^help gr3set^. An in-process graph may be saved by ^gr3save^ and retrieved later by ^gr3use^. You can draw a graph, ^gr3save^ it, do something else, and when you ^gr3use^ it, you may continue trying different options. See ^help gr3save^. Also see -------- STB: gr3 (STB-2), gr3.1 (STB-12) On-line: ^help^ for ^gr3save^, ^gr3set^