# Examples Of Program-generated Plots - HP 48gII User Manual

Graphing calculator.

'1+SIN(θ)' ` „ @@EQ@@
@) P PAR
{ θ 0 6.29} ` @INDEP
~y` @DEPND
3 \# 3 @XRNG
0.5 \# 2.5 @YRNG L
{ (0,0) {.5 .5} "x" "y"} `
@AXES
L @) P LOT
@ERASE @DRAX L @LABEL
L @DRAW
LL@) P ICT @CANCL
From these examples we see a pattern for the interactive generation of a two-
dimensional graph through the PLOT menu:
1 – Select PTYPE.
2 – Store function to plot in variable EQ (using the proper format, e.g.,
'X(t)+iY(t)' for PARAMETRIC).
3 – Enter name (and range, if necessary) of independent and dependent
variables
4 – Enter axes specifications as a list { center atick x-label y-label }
5 – Use ERASE, DRAX, LABEL, DRAW to produce a fully labeled graph with
axes
This same approach can be used to produce plots with a program, except
that in a program you need to add the command PICTURE after the DRAW
function is called to recall the graphics screen to the stack.

## Examples of program-generated plots

In this section we show how to implement with programs the generation of the
last three examples.
Activate the PLOT menu before you start typing the
program to facilitate entering graphing commands („ÌC, see above).
Example 1 – A function plot. Enter the following program:
Store complex funct. r = f(θ) into EQ
Show plot parameters
Define 'θ' as the indep. Variable
Define 'Y' as the dependent variable
Define (-3,3) as the x-range
Define (-0.5,2.5) as the y-range
Axes definition list
Define axes center, ticks, labels
Erase picture, draw axes, labels
Draw function and show picture
Page 22-17