@node Shade, Show, Set, Commands @iftex @syntax Shade. @end iftex @example Syntax: SHADE INTEGER pexpr pexpr SHADE HISTOGRAM INTEGER pexpr pexpr @end example @pindex Shade @findex shading regions (`Pexpr' is the name of a vector, or an expression in parentheses, e.g. @code{SHADE 1000 x (sqrt(y))}). Shade `inside' a curve defined by the expressions. The shading is rotated through the current value of @code{ANGLE}, and lines are spaced @code{INTEGER} apart (screen coordinates, so the full screen is 32768 across). If @code{INTEGER} is 0, the lines will be drawn as close together as the device allows, simulating an area fill. This is a very inefficient way to fill areas, made only slightly better by specifying a large @code{LWEIGHT} on devices that support such things in hardware (you'll also get slightly jagged edges). The meaning of `inside' is that as the shading is done, from left to right taking the value of @code{ANGLE} into account, lines are drawn from every odd to every even crossing of the curve. The curve is considered as being closed by joining the first to the last point. If a shading line just touches the curve the algorithm may be confused, change @code{INTEGER} slightly, or adding 180 to ANGLE. Sometimes joining the ends of the curve may not be what you want, try using @code{CONCAT} to add points on the end yourself. For example, @findex shade surprises @example SET x=0,10 SET y=x**2 LIMITS x y SHADE 1000 x y @end example @noindent looks like a new moon, but @example SHADE 1000 (x CONCAT 10) (y concat -1e10) @end example @noindent shades beneath the curve, for @code{ANGLE} 0 that is. You could also try the macros @code{scribble} and @code{shading} in demos, e.g. type @code{load demos scribble}. @code{SHADE HISTOGRAM} is similar, but it shades the histogram that would be drawn by @code{HISTOGRAM} from the same set of points. In this case the area to be shaded lies between the histogram and the line y=0. If this offends you, offset the whole graph and lie about the axes.