On the diagonal, the plot is simply a DOE mean plot with a single factor. For the off-diagonal plots, measurements at each level of the interaction are plotted versus level, where level is X i times X j and X i is the code for the ith main effect level and X j is the code for the jth main effect. For the common 2-level designs (i.e., each. The discontinuity is immediately visible only if it jumps out of a particular contour level. By default, plots have linear scales in each direction. 11.16 Step-by-step plots with low-level plotting functions (.) For R graphics, there are two types of plotting functions: high-level plotting functions create new plots, and low-level functions add elements to existing plots. You may see Chapter 12 (“Graphical procedures”) of the R manual An Introduction to R for more information. The solution: Level up the rewards and dangers the hero faces to add that extra oomph to the sequel while avoiding accusations of plot recycling. Instead of a mere Mafia boss, the Sorting Algorithm of Evil delivers a beady-eyed Diabolical Mastermind to deal with, but the hero can look forward to niftier powers and legacies.
11.16 Step-by-step plots with low-level plotting functions (*)
For R graphics, there are two types of plotting functions: high-level plotting functions create new plots, and low-level functions add elements to existing plots. You may see Chapter 12 (“Graphical procedures”) of the R manual An Introduction to R for more information.
By default, knitr does not show the intermediate plots when a series of low-level plotting functions are used to modify a previous plot. Only the last plot on which all low-level plotting changes have been made is shown.
It can be useful to show the intermediate plots, especially for teaching purposes. You can set the chunk option
fig.keep = 'low'
to keep low-level plotting changes. For example, Figure 11.3 and Figure 11.4 are from a single code chunk with the chunk option fig.keep = 'low'
, although they appear to be from two code chunks. We also assigned different figure captions to them with the chunk option fig.cap = c('A scatterplot ..', 'Adding a regression line..')
.FIGURE 11.3: A scatterplot of the cars data.
FIGURE 11.4: Adding a regression line to an existing scatterplot.
If you want to keep modifying a plot in a different code chunk, please see Section 14.5.
B_06_levelplot {lattice} | R Documentation |
![Level Level](https://www.researchgate.net/profile/Harold_Burkhart/publication/233485664/figure/download/tbl1/AS:670530977943576@1536878451985/Plot-level-characteristics-for-the-observations-used-in-this-analysis.png)
Level plots and contour plots
Description
Draws false color level plots and contour plots.
Usage
Arguments
x | for the formula method, a formula of the form z ~ x * y | g1 * g2 * .. , where z is a numeric response, andx , y are numeric values evaluated on a rectangulargrid. g1, g2, .. are optional conditional variables, andmust be either factors or shingles if present.Calculations are based on the assumption that all x and y values areevaluated on a grid (defined by their unique values). The functionwill not return an error if this is not true, but the display mightnot be meaningful. However, the x and y values need not be equallyspaced. Both levelplot and wireframe have methods formatrix , array , and table objects, in which casex provides the z vector described above, while itsrows and columns are interpreted as the x and y vectors respectively. This is similar to the form used infilled.contour and image . For higher-dimensionalarrays and tables, further dimensions are used as conditioningvariables. Note that the dimnames may be duplicated; this ishandled by calling make.unique to make the namesunique (although the original labels are used for the x- andy-axes). |
data | For the formula methods, an optional data frame in whichvariables in the formula (as well as groups andsubset , if any) are to be evaluated. Usually ignored with awarning in other cases. |
row.values, column.values | Optional vectors of values thatdefine the grid when x is a matrix. row.values andcolumn.values must have the same lengths as nrow(x) and ncol(x) respectively. By default, row and columnnumbers. |
panel | panel function used to create the display, as described in xyplot |
aspect | For the matrix methods, the default aspect ratio is chosen tomake each cell square. The usual default is aspect='fill' ,as described in xyplot . |
at | A numeric vector giving breakpoints along the range of z . Contours (if any) will be drawn at these heights, and theregions in between would be colored using col.regions . Inthe latter case, values outside the range of at will not bedrawn at all. This serves as a way to limit the range of the datashown, similar to what a zlim argument might have been usedfor. However, this also means that when supplying at explicitly, one has to be careful to include values outside therange of z to ensure that all the data are shown.at can have length one only if region=FALSE . |
col.regions | color vector to be used if regions is TRUE. Thegeneral idea is that this should be a color vector of moderatelylarge length (longer than the number of regions. By default this is100). It is expected that this vector would be gradually varying incolor (so that nearby colors would be similar). When the colors areactually chosen, they are chosen to be equally spaced along thisvector. When there are more regions than colors in col.regions , the colors are recycled. The actual colorassignment is performed by level.colors , which isdocumented separately. |
alpha.regions | numeric, specifying alpha transparency (works only on some devices) |
colorkey | logical specifying whether a color key is to be drawnalongside the plot, or a list describing the color key. The list maycontain the following components:
|
contour | A logical flag, indicating whether to draw contour lines. |
cuts | The number of levels the range of z would be divided into. |
labels | Typically a logical indicating whether contour lines should belabelled, but other possibilities for more sophisticated controlexists. Details are documented in the help page for panel.levelplot , to which this argument is passed onunchanged. That help page also documents the label.style argument, which affects how the labels are rendered. |
pretty | A logical flag, indicating whether to use pretty cut locations andlabels. |
region | A logical flag, indicating whether regions between contour linesshould be filled as in a level plot. |
allow.multiple, outer, prepanel, scales, strip, groups, xlab,xlim, ylab, ylim, drop.unused.levels, lattice.options,default.scales, subset | These arguments are described in the help page for xyplot . |
default.prepanel | Fallback prepanel function. See xyplot . |
.. | Further arguments may be supplied. Some are processed by levelplot or contourplot , and those that areunrecognized are passed on to the panel function. |
useRaster | A logical flag indicating whether raster representations should beused, both for the false color image and the color key (if present).Effectively, setting this to TRUE changes the default panelfunction from panel.levelplot topanel.levelplot.raster , and sets the default value ofcolorkey$raster to TRUE .Slots for real money realmoney.org. Note that panel.levelplot.raster provides only asubset of the features of panel.levelplot , but settinguseRaster=TRUE will not check whether any of the additionalfeatures have been requested.Not all devices support raster images. For devices that appear tolack support, useRaster=TRUE will be ignored with a warning. |
Details
![Vehicles Vehicles](/uploads/1/3/6/9/136902500/761279513.png)
These and all other high level Trellis functions have severalarguments in common. These are extensively documented only in thehelp page for
xyplot
, which should be consulted to learn moredetailed usage.Other useful arguments are mentioned in the help page for the defaultpanel function
panel.levelplot
(these are formallyarguments to the panel function, but can be specified in the highlevel calls directly).Value
An object of class
'trellis'
. Theupdate
method can be used toupdate components of the object and theprint
method (usually called bydefault) will plot it on an appropriate plotting device.Author(s)
Deepayan Sarkar [email protected]
References
Sarkar, Deepayan (2008) Lattice: Multivariate DataVisualization with R, Springer.http://lmdvr.r-forge.r-project.org/
See Also
See Full List On Farmville.fandom.com
xyplot
, Lattice
,panel.levelplot