The Graphics package provides classes that support a variety of statistical graphics and related computations. The basic constructs are: graphical objects and devices. The objects provide the content, the device is responsible for actually displaying that content.
A description of the graphics engine
discusses how the objects are organized: the fundamental idea is of
graphical elements that are displayed relative to a rectangular
region.
The graphical element is often defined recursively, to contain a
vector of simpler graphical elements.
At the bottom of the hierarchy are various primitive objects, such as
rectangles, lines, polygons, and text.
For each primitive object, and optionally for higher-level objects, a
draw method exists to say how this object should be
displayed by a device.
For the most part, programming with the Graphics package amounts to
defining the suitable class of graphical objects to display what you
want.
The actual display then amounts to creating whatever top-level window
or other display device you need, and adding the top-level graphical
object to the device, for example, with the device's plot method.
The package is organized into a set of sub-packages:
Output devices in interactive plotting are extensions of the Component class in Java. They also contain a graphics object to define the graphical content.