This vignette introduceszenplots (zigzag expandednavigation plots): compact displays for high-dimensional data thatalternate 1D and 2D plots along a zigzag path, sharing axes whenadjacent.
Azenplot can show the same information as apairs plot but with two important display differences.
First, the matrix organization of thepairs layout isreplaced by the “zig-zag” layout ofzenplot. Second, thenumber of plots produced is about half that of apairs plotallowing each plot in azenplot to be given more visualspace.
PairVizA convenient function to produce all pairs can be found in thePairViz package found oncran and installed inR viainstall.packages("PairViz").
if (!has_pairviz) {cat("> **Optional dependency**: Examples using the **PairViz** package are skipped if it’s not installed. Install with `install.packages(\"PairViz\")`.\n\n")}else {library(PairViz)}We will illustrate this functionality and the difference between apairs plot and azenplot by first consideringa small dataset on earthquakes having only a few variates. Thedifference between the two plots becomes much more important for datahaving larger numbers of variates – we illustrate the difference againusing German data on voting patterns in two elections.
The built-inR data set calledattenucontains measurements to estimate the attenuating effect of distance onthe ground acceleration of earthquakes in California.
There are 5 different variates used to describe the peak accelerationof 23 California earthquakes measured at different observation stations.The data set contains 182 different peak acceleration measurements andhas some missing data. The first few cases of the data set look like
## event mag station dist accel## 1 1 7.0 117 12 0.359## 2 2 7.4 1083 148 0.014## 3 2 7.4 1095 42 0.196## 4 2 7.4 283 85 0.135## 5 2 7.4 135 107 0.062## 6 2 7.4 475 109 0.054Its variates are
## [1] "event" "mag" "station" "dist" "accel"and we are interested in all pairs of these variates.
To get these, first imagine a graph having as its nodes the variatesof the data. An edge of this graph connects two nodes and hencerepresents a pair of variates. If interest lies in all pairs of varates,then the graph is a complete graph – it will have an edge between everypair of nodes. An ordering of variate pairs corresponds to any path onthe graph. To have an ordering of all pairs of variates, the path mustvisit all edges and is called an Eulerian, or Euler path. Such a pathalways exists for complete graphs on an odd number of nodes; when thenumber of nodes is even, extra edges must be added to the graph beforean Eulerian can exist.
For a complete graph with n nodes, the functioneseq(for Euler sequence) function from thePairViz packagereturns an order in which the nodes (numbered 1 to n) can be visited toproduce an Euler path. It works as follows.
## Since attenu has 5 variates, the complete graph has n=5 nodes## and an Euler sequence is given asPairViz::eseq(5)## [1] 1 2 3 1 4 2 5 3 4 5 1In terms of the variate names ofattenu, this is:
## [1] "event" "mag" "station" "event" "dist" "mag" "accel" ## [8] "station" "dist" "accel" "event"As can be seen in the corresponding complete graph below,Precomputed complete graph.
this sequence traces an Eulerian path on the complete graph and sopresents every variate next to every other variate somewhere in theorder.
Optional dependency: This graph, and any othergraph, in this vignette can be displayed as a Graphviz plot using theplot() method fromRgraphviz. To install locally:
if (!requireNamespace("BiocManager",quietly=TRUE))install.packages("BiocManager")BiocManager::install("Rgraphviz")If theRgraphviz package is installed, then the abovegraph could be produced as follows:
zenpathThis functionality (and more) fromPairViz has beenbundled together in thezenplots package as a singlefunctionzenpath. For example,
## [1] 5 1 2 3 1 4 2 5 3 4 5This sequence, while still Eulerian, is slightly different than thatreturned byeseq(5). The sequence is chosen so that allpairs involving the first index appear earliest in the sequence, thenall pairs involving the second index, and so on. We call this a “frontloaded” sequence and identify it with thezenpath argumentmethod = "front.loaded". Other possibilities aremethod = "back.loaded" andmethod = "balanced"giving the following sequences:
## Back loading ensures all pairs appear latest (back) for## high values of the indices.zenpath(5,method ="back.loaded")## [1] 1 2 3 1 4 2 5 3 4 5 1## Frot loading ensures all pairs appear earliest (front) for## low values of the indices.zenpath(5,method ="front.loaded")## [1] 5 1 2 3 1 4 2 5 3 4 5## Balanced loading ensures all pairs appear in groups of all## indices (Hamiltonian paths -> a Hamiltonian decomposition of the Eulerian)zenpath(5,method ="balanced")## [1] 1 2 3 5 4 1 3 4 2 5 1The differences are easier to see when there are more nodes. Below,we show the index ordering (top to bottom) for each of these threemethods when the graph has 15 nodes, here labelled”a” to “o” (to makeplotting easier).
Starting from the bottom (the back of the sequence), “back loading”has the last index, “o”, complete its pairing with every other indexbefore “n” completes all of its pairings. All of “n”’s pairings completebefore those of “m”, all of “m”’s before “l”, and so on until the lastpairing of “a” and “b” are completed. Note that the last indices stillappear at the end of the sequence (since the sequence begins at the topof the display and moves down). The term “back loading” is used here ina double sense - the later (back) indices have their pairings appear asclosely together as possible towards the back of the returned sequence.A simple reversal, that isrev(zenpath(15, method = "back.loaded")), would have themappear at the beginning of the sequence. In this case the “back loading”would only be in one sense, namely that the later indexed (back) nodesappear first in the reversed sequence.
Analogously, “front loading” has the first (front) indices appear atthe front of the sequence with their pairings appear as closely togetheras possible.
The “balanced” case ensures that all indices appear in each block ofpairings. In the figure there are 7 blocks.
All three sequences are Eulerian, meaning all pairs appear somewherein each sequence.
Eulerian sequences can now be used to compare apairsplot with azenplot when all pairs of variates are to bedisplayed.
First a pairs plot:
## We remove the space between plots and suppress the axes## so as to give maximal space to the individual scatterplots.## We also choose a different plotting character and reduce## its size to better distinguish points.pairs(attenu,oma=rep(0,4),gap=0,xaxt="n",yaxt="n")We now effect a display of all pairs usingzenplot.
## Plotting character and size are chosen to match that## of the pairs plot.## zenpath ensures that all pairs of variates appear## in the zenplot.## The last argument, n2dcol, is chosen so that the zenplot## has the same number of plots across the page as does the## pairs plot.zenplot(attenu[,zenpath(ncol(attenu))],n2dcol=4)Each display shows scatterplot of allchoose(5,2) = 10pairs of variates for this data. Each display occupies the same totalarea.
Withpairs each plot is displayed twice and arranged ina symmetric matrix layout with the variate labels appearing along thediagonal. This makes for easy look-up but uses a lot of space.
Withzenplot, each plot appears only once with itscoordinate defining variates appearing as labels on horizontal (top orbottom) and vertical (left or right) axis positions. The layout followsthe order of the variates in which the variates appear in the call tozenplot beginning in the top left corner of the display andthen zig-zagging from top left to bottom right; when the rightmostboundary or the display is reached, the direction is reversedhorizontally and the zigzag moves from top right to bottom left. Thefollowing display illustrates the pattern (had by simply callingzenplot):
## Call zenplot exactly as before, except that each scatterplot is replaced## by an arrow that shows the direction of the layout.zenplot(attenu[,zenpath(ncol(attenu))],plot2d="arrow",n2dcol=4)The zig zag pattern of plots appears as follows.
zenplot display) hashorizontal variateevent and vertical variatemag.mag but now with horizontal variatestation.Note that the variatestation has some missing values andthis is recorded on its label asstation (some NA).station but now with vertical variateevent.Since this is the first repeat appearance ofevent itappears with a suffix asevent.1.event and new horizontal variatedist.dist and as vertical variate the first repeat of thevariatemag.mag and new horizontal variateaccel.Like thepairs plot, thezenplot lays itsplots out on a two dimensional grid – the argumentn2dcol=4specifies the number of columns for the 2d plots (e.g. scatterplots). Asshown, this can lead to a lot of unused space in the display.
Thezenplot layout can be made more compact by differentchoices of the argumentn2dcol (odd values provide a morecompact layout). For example,
By default,zenplot tries to determine a value forn2dcol that minimizes the space unused by its zigzaglayout.
with layout directions as
As the direction arrows show, the default layout is to zigzaghorizontally first as much as possible.
This is clearly a much more compact display. Again, axes are sharedwherever a label appears between plots.
Unless explicitly specified, the value ofn2dcol isdetermined by the aregumentscaling which can either be anumerical value specifying the ratio of the height to the width of thezenplot layout or be a string describing a page whose ratioof height to width will be used. The possible strings areletter'' (the default),square’‘,A4'',golden’’(for the golden ratio), or ``legal’’.
The display arrangement of a scatterplot matrix facilitates thelookup of the scatterplot for any particular pair of variates by simplyidentifying the corresponding row and columns.
The scatterplot matrix also simplifies the visual comparison of theone variate to each of several others by scanning along any single row(or column). Note however that this single row scan does come at theprice of doubling the number of scatterplots in the display.
These two visual search facilities are diminished by the layout of azenplot. Although the same information is available in azenplot the layout does not lend itself to easy lookup fromvariates to plots. If thezenplot layout is used in aninteractive graphical system, other means of interaction could beimplemented to have, for example, all plots containing a particularvariate (or pair of variates) distinguish themselves visually by havingtheir background colour change temporarily.
On the other hand, the reverse lookup from plot to variates issimpler in azenplot than in a scatterplot matrix,particularly for large numbers of variates.
Both layouts allow a visual search for patterns in the pointconfigurations. Having many plots be presented at once enables a quickvisual search over a large space for the existence of interesting pointconfigurations (e.g. correlations, outliers, grouping in data, lines,etc.).
When the number of plots is very large, an efficient compact layoutcan dramatically increase the size of the visual search space. This iswherezenplot’s zigzag layout outperforms the scatterplotmatrix.
This could be illustrated this on the following example.
In thezenplots package the data setde_elect contains the district results of two Germanfederal elections (2002 and 2005) as well as a number of socio-economicvariates as well.
There are 299 districts and 68 variates yielding a possiblechoose(68,2) = 2278 different scatterplots.
This many scatterplots will overwhelm apairs plot. Inits most compact form, the pairs plot for the first 34 variates alreadyoccupies a fair bit of space:
(N.B. We do not execute any of these large plots simply to keep thestorage needs of this vignette to a minimum. We do encourage the readerto execute the code however on their own.)
If you execute the above code you will see interesting pointconfigurations including: some very strong positive correlations, somepositive and negative correlations, non-linear relations, the existenceof some outlying points, clustering, striation, etc.
Because this scatterplot matrix is for only half of the variates itshowschoose(34,2) = 561 different scatterplots, each onetwice. For a display of 1122 plots, only about one quarter of all 2278pairwise variate scatterplots available in the data set appear in thisdisplay.
A second scatterplot matrix on the remaining 34 variates would alsoshow only a quarter of the plots. The remaining half,\(34 \times 34 = 1156\) plots, are missingfrom both plots.
In contrast, thezenplot shows all 2278 plots at once.In fact, because an Eulerian sequence requires a graph to be even(i.e. each node has an even number of edges), whenever the number ofvariates,\(p\), is evenzenpath(...) will repeat exactly\(p/2\) pairs somewhere in the sequence itreturns.
To produce thezenplot of all pairs of variates on theGerman election data we callzenplot(de_elect[,zenpath(68)], pch="."). (Again, we don’tproduce it here so as to minimize the storage footprint of thisvignette.)
## Try invoking the plot with the following## zenplot(de_elect[,zenpath(68)], pch=".", n2dcol="square",col=adjustcolor("black",0.5))In approximately the same visual space as the scatterplot matrix(showing only 561 unique plots), thezenplot hasefficiently and compactly laid out all 2278 different plots plusr ncol(de_elect) duplicate plots. This efficient layoutmeans thatzenplot can facilitate visual search forinteresting point configurations over much larger collections of variatepairs – in the case of the German election data, this all possible pairsof variates are presented simultaneously.
In contrast, all pairs loses most of the detail
Zenplots also accomodate a list of data sets whose pairwise contentsare to be displayed. The need for this can arise quite naturally in manyapplications.
The German election data, for instance, contains socio-economic datawhose variates naturally group together. For example, we might gathervariates related to education into one group and those related toemployment into another.
Education<-c("School.finishers","School.wo.2nd","School.2nd","School.Real","School.UED")Employment<-c("Employed","FFF","Industry","CTT","OS" )We could plot all pairs for these two groups in a singlezenplot.
EducationData<- de_elect[, Education]EmploymentData<- de_elect[, Employment]## Plot all pairs within each groupzenplot(list(Educ= EducationData[,zenpath(ncol(EducationData))],Empl= EmploymentData[,zenpath(ncol(EmploymentData))]))All pairs of education variates are plotted first in zigzag orderfollowed by a blank plot then continuing in the same zigzag pattern byplots all pairs of employment variates.
In addition to theEducation andEmploymentgroups above, a number of different groupings of variates having ashared context. For example, these might include the following:
## Grouping variates in the German election dataRegions<-c("District","State","Density")PopDist<-c("Men","Citizens","Pop.18.25","Pop.25.35","Pop.35.60","Pop.g.60")PopChange<-c("Births","Deaths","Move.in","Move.out","Increase")Agriculture<-c("Farms","Agriculture")Mining<-c("Mining","Mining.employees")Apt<-c("Apt.new","Apt")Motorized<-c("Motorized")Education<-c("School.finishers","School.wo.2nd","School.2nd","School.Real","School.UED")Unemployment<-c("Unemployment.03","Unemployment.04")Employment<-c("Employed","FFF","Industry","CTT","OS" )Voting.05<-c("Voters.05","Votes.05","Invalid.05","Valid.05")Voting.02<-c("Voters.02","Votes.02","Invalid.02","Valid.02")Voting<-c(Voting.02, Voting.05)VotesByParty.02<-c("Votes.SPD.02","Votes.CDU.CSU.02","Votes.Gruene.02","Votes.FDP.02","Votes.Linke.02")VotesByParty.05<-c("Votes.SPD.05","Votes.CDU.CSU.05","Votes.Gruene.05","Votes.FDP.05","Votes.Linke.05")VotesByParty<-c(VotesByParty.02, VotesByParty.05)PercentByParty.02<-c("SPD.02","CDU.CSU.02","Gruene.02","FDP.02","Linke.02","Others.02")PercentByParty.05<-c("SPD.05","CDU.CSU.05","Gruene.05","FDP.05","Linke.05","Others.05")PercentByParty<-c(PercentByParty.02, PercentByParty.05)The groups can now be used to explore internal group relations formany different groups in the same plot. Here the following helperfunction comes in handy.
groups<-list(Regions=Regions,Pop=PopDist,Change = PopChange,Agric=Agriculture,Mining=Mining,Apt=Apt,Cars=Motorized,Educ=Education,Unemployed=Unemployment,Employed=Employment#,# Vote02=Voting.02, Vote05=Voting.05,# Party02=VotesByParty.02, Party05=VotesByParty.05,# Perc02=PercentByParty.02, Perc05=PercentByParty.05 )group_paths<-lapply(groups,FUN=function(g) g[zenpath(length(g),method ="front.loaded")] )x<-groupData(de_elect,indices=group_paths)zenplot(x,pch =".",cex=0.7,col ="grey10")All pairs within each group are presented following the zigzagpattern; each group is separated by an empty plot. Thezenplot provides a quick overview of the pairwiserelationships between variates within all groups.
The plot can be improved some by using shorter names for thevariates. With a little work we can replace these within each group ofx.
### Grouping variates in the German election dataRegionsShort<-c("ED","State","density")PopDistShort<-c("men","citizen","18-25","25-35","35-60","> 60")PopChangeShort<-c("births","deaths","in","out","up")AgricultureShort<-c("farms","hectares")MiningShort<-c("firms","employees")AptShort<-c("new","all")TransportationShort<-c("cars")EducationShort<-c("finishers","no.2nd","2nd","Real","UED")UnemploymentShort<-c("03","04")EmploymentShort<-c("employed","FFF","Industry","CTT","OS" )Voting.05Short<-c("eligible","votes","invalid","valid")Voting.02Short<-c("eligible","votes","invalid","valid")VotesByParty.02Short<-c("SPD","CDU.CSU","Gruene","FDP","Linke")VotesByParty.05Short<-c("SPD","CDU.CSU","Gruene","FDP","Linke")PercentByParty.02Short<-c("SPD","CDU.CSU","Gruene","FDP","Linke","rest")PercentByParty.05Short<-c("SPD","CDU.CSU","Gruene","FDP","Linke","rest")shortNames<-list(RegionsShort, PopDistShort, PopChangeShort, AgricultureShort, MiningShort, AptShort, TransportationShort, EducationShort, UnemploymentShort, EmploymentShort, Voting.05Short, Voting.02Short, VotesByParty.02Short, VotesByParty.05Short, PercentByParty.02Short, PercentByParty.05Short)# Now replace the names in x by these.nGroups<-length(x)for (iin1:nGroups) { longNames<-colnames(x[[i]]) newNames<- shortNames[[i]] oldNames<- groups[[i]]#print(longNames)#print(newNames)for (jin1:length(longNames)) {for (kin1:length(newNames)) {if (grepl(oldNames[k], longNames[j])) { longNames[longNames== longNames[j]]<- newNames[k] } } }colnames(x[[i]])<- longNames}zenplot(x,pch =".",cex=0.75)It can also be of interest to compare variates between groups. Forexample, to compare the various levels of education with the employmentcategories.
crossedGroups<-c(Employment, Education)crossedPaths<-zenpath(c(length(Employment),length(Education)),method="eulerian.cross")zenplot(de_elect[,crossedGroups][crossedPaths])Azenplot can be thought of as taking a data set whosevariates are to be plotted in the order given. A sequence of onedimensional plots, as determined by the argumentplot1d,are constructed in the order of the variates. Between each pair of these1d plots, a two dimensional plot is constructed from thevariates of the1d plots. One variate provides the verticaly values and the other the horizontalxvalues. If the orientation of the preceding one-dimensional plot ishorizontal, then that variate gives thex values; if it’svertical then the verticaly coordinates.
1d and2d plotsThe actual displays depend on the argumentsplot1d andplot2d. There are numerous built-in choices provided.
Forplot1d any of the following strings may be selectedto produce a one-dimensional plot:"label","rug","points","jitter","density","boxplot","hist","arrow","rect","lines". Thefirst in the list is the default.
Forplot2d any of the following strings can be given:"points","density","axes","label","arrow","rect". Again,the first of these is the default value.
turnsFor example, we could produce aboxplot for the measuredvariates of the earthquake data as follows:
earthquakes<- attenu[,c(1,2,4,5)]# ignore the station idzenplot(earthquakes,plot1d="boxplot",plot2d=NULL,width1d=5,width2d=1,turns=c("r","r","r","r","r","r","r"))There are a few things to note here. First that every variate in thedata set has a boxplot of its values presented and that the extent ofboxplot display is that variate’s range. Second, the argumentspecificationplot2d=NULL causes a null plot to be producedfor each of the variate pairs. Third, the argumentswidth1dandwidth2d determine the relative widths of the twodisplays.
Finally, the argumentturns determines the layout of theplots by specifying where the next display (1d or2d) is to appear in relation to the current one. Here everydisplay appears to the right of the existing display.
An alternative layout of the same boxplots can be had by adjustingtheturns.
zenplot(earthquakes,plot1d="boxplot",plot2d=NULL,width1d=1,width2d=1,# now widths must be the sameturns=c("r","d","d","l","l","u","u"))To better see how the turns work, arrows could be used instead toshow the directions of the turns.
zenplot(earthquakes,plot1d="arrow",plot2d="arrow",width1d=1,width2d=2,turns=c("r","d","d","l","l","u","u"))Adding a rectangle to outline the drawing space will make the layouta little clearer and illustrate the arguments that are passed on to thepne and two dimensional plot functions.
zenplot(earthquakes,plot1d =function(zargs, ...) {rect_1d_graphics(zargs, ...)arrow_1d_graphics(zargs,col="firebrick",lwd=3,add=TRUE, ...) },plot2d =function(zargs, ...) {rect_2d_graphics(zargs, ...)arrow_2d_graphics(zargs,col="steelblue",lwd=3,lty=2,add=TRUE, ...) },width1d =1,width2d =2,turns=c("r","d","d","l","l","u","u"))The red arrows are the turns for the1d plots, the bluedashed arrows for the2d plots. The turns are interlacedand begin at the topmost red arrow for the1d plot. Itpoints right, matching the first turn"r" in the list ofturns. The remaining arrows follow each other in clockwiseorder. As can be seen, there is an arrow for each plot: red for the1d plots, black for the2d plots.
The above example also introduces some other important features ofzenplot.
The value"arrow" ofplot2d argument causedan arrow to be drawn wherever a2d plot was to appear inthe direction of the turn associated with that plot. As the value ofplot1d here suggests, the argument could also have been afunction.
In fact, when given a string value forplot2d,zenplot calls a function whose name is constructed withthis string. In the case ofplot2d = "arrow",zenplot calls the functionarrow_2d_graphicsto produce a2d plot whenever one is required. The namingconvention constructs the function name from the string supplied, here“arrow”, the dimensionality of the plot (here2d) and theR graphics package that is being used (here the basegraphics package). The function of that name is called onarguments appropriate to draw the plot.
The same construction is also used when a string is given as thevalue of theplot1d argument. For exampleplot1d = "arrow" causes the function namedarrow_1d_graphics to be called to draw the1dplots.
Should, for example, the user wish to extend the base functionalityofzenplot to include say"myplot", they needonly write functionsmyplot_1d_graphics and/ormyplot_2d_graphics to allow the value"myplot"to be used forplot1d and/orplot2d in thebasegraphics package inR. Note that twootherR plotting packages besides the basegraphics are supported byzenplot, namelyeither the highly customizablegrid package or the highlyinteractiveloon package. The default package isgraphics but either of the other two may be specified viathepkg argument tozenplot as inpkg = "grid" orpkg = "loon".
Whenzenplot is called withplot1d="arrow",say, then one of the functionsarrow_1d_graphics,arrow_1d_grid, orarrow_1d_loon will be calledupon depending on the value of the argumentpkg. This meansthat a true extension ofzenplot to include, say,plot1d = "myplot" would require writing three functions,namelymyplot_1d_graphics,myplot_1d_grid, andmyplot_1d_loon, to complete the functionality.
More often, as shown in the boxplot example, it will be a one-offfunctionality that might be required for eitherplot2d orplot1d.
In this case, any function passed as the argument value will be usedbyzenplot to construct the corresponding plots. In theboxplot example, the default functionsboxplot_1d_graphicsandarrow_1d_graphics were both called so that one could beplotted on top of the other in each1d plot of thezenplot.
zenplot can be used to layout graphics produced by anyof the threepkg (i.e. graphics,grid, orloon) provided all graphics used arefrom thesame package.
For example, suppose we were interested in the marginal distributionsof the earthquake data. We might craft the following plot to investigateall marginal distributions and to compare each marginal to every other(i.e. all pairs).
## qqtest is preferred to the base qqplot so will be used if available.#has_qqtest<-requireNamespace("qqtest",quietly =TRUE)zenplot(earthquakes[,zenpath(ncol(earthquakes))],width1d =1,width2d =2,n2dcols =5,plot1d =function(zargs, ...) { r<-extract_1d(zargs)# extract args for 1d col<- grDevices::adjustcolor(if (r$horizontal)"firebrick"else"steelblue",alpha.f =0.7)hist_1d_graphics(zargs,col = col, ...) },plot2d =function(zargs, ...) { r<-extract_2d(zargs)# extract args for 2d x<-as.matrix(r$x)# r$x is a data frame with one named variate# one-column data frame -> matrix xlim<- r$xlim y<-as.matrix(r$y)# r$y is a data frame with one named variate ylim<- r$ylim# use the better quantile-quantile plot (qqtest) if available# qqtest has bands testing whether y comes from the same# distribution as x or not; all points in the band# indicate no evidence against the hypothesis of the# same distribution,if (has_qqtest) {# qqtest draws directly into the current region qqtest::qqtest(y,dataTest = x,xlim = xlim,ylim = ylim,cex =0.3,col ="black",pch =19,legend =FALSE,main ="",axes =FALSE, ...) }else {# base fallback:# construct the qqplot by hand# adding the points into our region xx<<- stats::na.omit(as.numeric(x)) yy<<- stats::na.omit(as.numeric(y)) qq<- stats::qqplot(xx, yy,plot.it =FALSE)plot_region(xlim, ylim)box()points(qq$x, qq$y,pch =19,cex =0.3) } })Here we are using the functionqqtest from the packageof that name and whose display capability is built using only the basegraphics package. For2d dataqqtest compares the two empirical distributions by drawingan empirical quantile-quantile plot which should be near a straight lineif the marginal distributions are of the same shape. The empiricalquantile-quantile plot is supplemented by simulated values of empiricalquantiles from the empirical distribution of the horizontal variate. Theresults of 1,000 draws from this distribution are shown in shades ofgrey on the qqplot. The1d plots are shown as histogramscoloured"grey" when that histogram was used to generatethe simulated values and in"steelblue" when the histogramwas not.
As can be seen from the qqplots, since numerous points are outsidethe gray envelopes of each plot, no two marginal distributions wouldappear to be alike.
plot1d functionsEveryplot1d function must take arbitrarily manyarguments, accepting at least the following set:
x, a vector of values for a single variatehorizontal, which isTRUE if the1d plot is to be horizontal,plotAsp, the aspect ratio of the plot (i.e. thesmaller/larger side ration in [0,1])turn, the single character turn out from the currentplotplotID, a list containing information on theidentification of theplot.If theplot1d function is from the packagegrid, then it should also expect to receive avp or viewport argument; if it is from the packageloon, it might also receive aparent argument.These arguments should be familiar to users of either package.
For aplot1d function, theplotID consistsof
group, the number of the group in which this1d plot is placed,number.within.group, the within group index of thisvariate,index , the index of the variate among all variates inthe data set(s)label, the variate label, andplotNo, the number of the1d plot beingdisplayed (i.e its position in order among only those which are1d).All other functions in the ellipsis,..., are passed onto the drawing functions.
plot2d functionsEveryplot2d function must take arbitrarily manyarguments, accepting at least the following set:
x, a vector of values for the horizontal variatey, a vector of values for the vertical variateturn, the single character turn out from the currentplotplotID, a list containing information on theidentification of theplot.If theplot2d function is from the packagegrid, then it should also expect to receive avp or viewport argument; if it is from the packageloon, it might also receive aparent argument.These arguments should be familiar to users of either package.
For aplot2d function, theplotID consistsof
group, the number of the group in which this2d plot is placed,number.within.group, the within group index for thesevariates (same index),index , the indices of the variates among all variatesin the data set(s)label, the labels of the variates, andplotNo, the number of the2d the plotbeing displayed (i.e its position in order among only those which are2d).All other functions in the ellipsis,..., are passed onto the drawing functions.