Previous: Replicating Analyses Up: User's Guide Next: Drawing Plots


Graphing Commands

R, and thus Zelig, can produce exceptionally beautiful plots. Many built-in plotting functions exist, including scatter plots, line charts, histograms, bar charts, pie charts, ternary diagrams, contour plots, and a variety of three-dimensional graphs. If you desire, you can exercise a high degree of control to generate just the right graphic. Zelig includes several default plots for one-observation simulations for each model. To view these plots on-screen, simply type plot(s.out), where s.out is the output from sim(). Depending on the model chosen, plot() will return different plots.

If you wish to create your own plots, this section reviews the most basic procedures for creating and saving two-dimensional plots. R plots material in two steps:

  1. You must call an output device (discussed in Section [*]), select a type of plot, draw a plotting region, draw axes, and plot the given data. At this stage, you may also define axes labels, the plot title, and colors for the plotted data. Step one is described in Section [*] below.
  2. Optionally, you may add points, lines, text, or a legend to the existing plot. These commands are described in Section [*].



Subsections

Gary King 2011-11-29