Programmatic Use Of Statistics And Plotting - HP 48gII Advanced User's Reference Manual

Graphing calculator
Hide thumbs Also See for 48gII:
Table of Contents

Advertisement

Programmatic Use of Statistics and Plotting

This section describes a program PIE you can use to draw pie charts. PIE prompts for single variable data,
stores that data in the statistics matrix DAT, then draws a labeled pie chart that shows each data point as a
percentage of the total.
Techniques used in PIE
Programmatic use of PLOT commands. PIE executes XRNG and YRNG to define x- and y-axis display
!
ranges in user units, and executes ARC and LINE to draw the circle and individual slices.
Programmatic use of matrices and statistics commands.
!
Manipulating graphics objects. PIE recalls PICT to the stack and executes GOR to merge the label for each
!
slice with the plot.
FOR...NEXT (definite loop). Each slice is calculated, drawn, and labeled in a definite loop.
!
CASE...END structure. To avoid overwriting the circle, each label is offset from the midpoint of the arc of
!
the slice. The offset for each label depends on the position of the slice in the circle. The CASE...END
structure assigns an offset to the label based on the position of the slice.
Preserving calculator flag status. Before specifying Radians mode, PIE saves the current flag status in a
!
local variable, then restores that status at the end of the program.
Nested local variable structures. At different parts of the process, intermediate results are saved in local
!
variables for convenient recall as needed.
Temporary menu for data input.
!
PIE program listing
Program:
«
RCLF  flags
«
RAD
{{ "SLICE" ...+ }
TMENU
"Key values into
SLICE
restarts program."
PROMPT
ERASE 1 131 XRNG
1 64 YRNG CLLCD
2-34 RPL Programming Examples
{ }
{ "CLEAR" CL... }
{ } { }
{ "DRAW" CONT }}
DRAW
Comments:
Recalls the current flag status
and stores it in variable flags.
Sets Radians mode.
Defines the input menu: key 1
executes + to store each data
point in DAT, key 3 clears
DAT, and key 6 continues
program execution after data
entry.
Displays the temporary menu.
Prompts for inputs.
represents the newline
character (... ë) after you
enter the program on the stack.
Erases the current PICT and
sets plot parameters.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

49g+

Table of Contents