What are Stata graphs

o Nested collections of class-system objects

o Objects containing sub-objects including styles describing how
they are to look - styles

o Objects capable of drawing themselves

o Objects containing scripts (or logs) for reproducing themselves

You will probably be surprised to hear that I do not think of the graph
command as Stata's graphics. Rather, graph is a not-so-thin parsing and
object creation engine that creates objects in the class system. Objects that
know how to draw themselves and replay themselves from files. And, objects
that can contain other objects.

It is the direct manipulation of these objects that lies at the heart of the
graphics system.

There are a few computer science terms that we should mention about the
object-oriented programming paradigm on which the graphics system is built.
In themselves they are not that helpful for the topic at hand, but they
provide a context for how things are done in the graphics classes.

What is special about objects?

o Encapsulation - programs and data are bound meaning that
class member programs run only on objects for that class

o Inheritance - classes/objects can inherit their data
(perhaps sub-objects) and member programs from an already existing
class

o Polymorphism - member programs with the same names can work
differently for different classes of objects.

What all of this means for our purposes is that we can create a graph object
for ourselves by inheriting from another object and picking up all of
that object's characteristics - both data (variables) and programs. It
also means that programs, and we are talking about pretty-much standard ado
programs, are associated with a particular object (or really class of object)
and that program can only be run on objects of its own class.

The object-oriented programming facilities in Stata, but not the graphics
classes themselves, are documented in [P] class or in help class.

For those wanting to know little more about the structure of graphs, the
following ancillary slides introduce some material differently than the talk.

>>What is the graph command (ancillary)

>>What are saved graphs (ancillary)

>>A touch of class - quick review (ancillary)

>>You gotta have style (ancillary)

<< index >>