Description Usage Arguments Author(s) See Also Examples
This function is a wrapper around image
and contour
. See vignette('plotfunctions')
for an example of how you could use image
and
contour
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
data |
Data frame or list with plot data. A data frame needs to have a column with x values, a column with y values and a column with z values. A list contains a vector with unique x values, a vector with unique y values, and a matrix with z-values. The output of the function fvisgam is an example of a suitable list. |
view |
A vector with the names or numbers of the columns to plot on the x axis and y axis respectively. |
predictor |
Optional: the name of the column in the data frame
|
valCI |
Optional: the name of the column in the data frame
|
main |
Text string, an overall title for the plot. |
xlab |
Label for x axis. Default is name of first |
ylab |
Label for y axis. Default is name of second |
xlim |
x-limits for the plot. |
ylim |
y-limits for the plot. |
zlim |
z-limits for the plot. |
col |
Color for the contour lines and labels. |
color |
The color scheme to use for plots. One of 'topo', 'heat',
'cm', 'terrain', 'gray', 'bwr' (blue-white-red) or 'bw'. Or a list of colors such as that
generated by |
ci.col |
Two-value vector with colors for the lower CI contour lines and for the upper CI contour lines. |
nCol |
The number of colors to use in color schemes. |
add.color.legend |
Logical: whether or not to add a color legend.
Default is TRUE. If FALSE (omitted), one could use the function
|
dec |
Numeric: number of decimals for rounding the color legend.
When NULL (default), no rounding. If -1 (default), automatically determined.
Note: if value = -1 (default), rounding will be applied also when
|
fit.margin |
Logical: whether the labels of the gradient legend should be forced to fit in the margin or not. |
... |
Optional parameters for |
Jacolien van Rij
Other Functions for plotting:
addInterval()
,
add_bars()
,
add_n_points()
,
alphaPalette()
,
alpha()
,
check_normaldist()
,
color_contour()
,
dotplot_error()
,
drawDevArrows()
,
emptyPlot()
,
errorBars()
,
fill_area()
,
getCoords()
,
getFigCoords()
,
getProps()
,
gradientLegend()
,
legend_margin()
,
marginDensityPlot()
,
plot_error()
,
plot_image()
,
sortBoxplot()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # From the package graphics, see help(image):
x <- 10*(1:nrow(volcano))
y <- 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
contour(x, y, volcano, levels = seq(90, 200, by = 5),
add = TRUE, col = 'peru')
axis(1, at = seq(100, 800, by = 100))
axis(2, at = seq(100, 600, by = 100))
box()
title(main = 'Maunga Whau Volcano', font.main = 4)
# now with plot surface:
# first convert to data frame
tmp <- data.frame(value = as.vector(volcano),
x = 10*rep(1:nrow(volcano), ncol(volcano)),
y = 10*rep(1:ncol(volcano), each=nrow(volcano)))
plotsurface(tmp, view=c('x', 'y'), predictor='value',
main='Maunga Whau Volcano')
# or with gray scale colors:
plotsurface(tmp, view=c('x', 'y'), predictor='value',
main='Maunga Whau Volcano', color='gray')
# change color range:
plotsurface(tmp, view=c('x', 'y'), predictor='value',
main='Maunga Whau Volcano', zlim=c(0,200))
#' remove color and color legend:
plotsurface(tmp, view=c('x', 'y'), predictor='value',
main='Maunga Whau Volcano',
color=NULL, col=1, add.color.legend=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.