Graphics Reference
In-Depth Information
panelshows the relationship between certain variables given the values of other vari-
ables. he concept behind trellis displays is implemented in many data visualization
systems. We are going to use the notation introduced by Deepayan Sarkar in his R
package lattice. he structure of the plot that is produced is mostly controlled by the
argument of the formula. he formula is generally of the form y~x
...,
indicating that plots of y (on the y axis) versus x (on the x axis) should be pro-
duced,conditional onthe variables g , g ,....Iftheconditioningvariablesareomit-
ted, the trellis display consists of a single panel, showing the relationship between x
and y. For low-dimensional plots, such as barcharts or dot plots, the y variable can
be omitted too. A separate panel is produced for each unique combination of val-
ues of conditioning variables g , g ,... usingthepoints
g
g
for the subset of the
data (also called the packet) defined bythat combination. he order of the panels de-
pends on the order in which the conditioning variables are specified, with g varying
fastest.
Figure . shows an example of a trellis display of three continuous variables -
depth,latitudeandlongitude-representingthelocationsofearthquakesintheTonga
Trench. helocation of each earthquake is plotted in a scatterplot, and the trellis dis-
playisorganizedaccordingtoearthquakedepth.hefollowinglinesofRwillproduce
the plot in Fig. . .
> library(lattice)
> data(quakes)
> Depth <- equal.count(quakes$depth,number=8,overlap=.1)
> trellis.par.set(theme=col.whitebg())
> xyplot(lat ~ long | Depth,data=quakes,asp=1.0,pch=20)
(
x, y
)
Figure . . Scatter plots of locations of earthquakes in a trellis framework. he observations in each
panel are organized according to the depth at which the earthquake happened
Search WWH ::




Custom Search