| densityPlot | R Documentation |
This function creates a density plot.
densityPlot(
df,
title = NULL,
colorScheme = c("cloudy", "cake", "grapes", "lava", "oasis", "orichalc", "sea", "sky",
"custom"),
useSchemeDefaults = TRUE,
drawNN = TRUE,
drawScores = FALSE,
xLab = NULL,
yLab = NULL,
legendTitle = "Density",
palette = NULL,
segColor = "black",
pointSize = 1,
pointColor = "red",
segType = c("dashed", "solid", "dotted", "dotdash", "longdash", "twodash"),
segWidth = 0.4,
nGridPoints = 300,
expandPerc = 20,
labelType = c("free", "boxed"),
labelSize = 3,
labelColor = "black",
labelRepulsion = 1,
labelPull = 1,
maxOverlaps = 10,
labelPadding = 0,
boxPadding = 0,
labelSegWidth = 0.4,
legendPos = c("right", "none"),
legendTextSize = 10,
legendTitleSize = 10,
axisTextSize = 12,
axisTitleSize = 12,
verbose = FALSE,
...
)
df |
A data frame with at least two columns, representing the |
title |
Plot title. |
colorScheme |
Color scheme. Choose between 'cake', 'cloudy', 'grapes', 'lava', oasis', 'orichalc', 'sea', 'sky' and 'custom'. Default is 'cloudy'. |
useSchemeDefaults |
Whether to use the default |
drawNN |
Whether to draw segments linking each point to its nearest neighbor. |
drawScores |
Whether to render scores on the plot. If set to
|
xLab |
x axis label. |
yLab |
y axis label. |
legendTitle |
Legend title. |
palette |
A character vector of colors. Used only if color scheme is set to 'custom'. |
segColor |
Nearest neighbor segment color. Ignored if |
pointSize |
Point size. |
pointColor |
Point color. Ignored if |
segType |
Nearest neighbor segment type. Choose between 'solid',
'dashed', 'dotted','dotdash', 'longdash' and 'twodash'. Ignored if
|
segWidth |
Nearest neighbor segment width. Ignored if |
nGridPoints |
Number of grid points in each direction. |
expandPerc |
Percentage by which the grid will be expanded. |
labelType |
Whether to draw a box around labels (option 'boxed') or not (option 'free'). Default is 'free'. |
labelSize |
Label size. |
labelColor |
Label color. Ignored if |
labelRepulsion |
Repulsion strength between labels. |
labelPull |
Attraction strength between a text label and its data point. |
maxOverlaps |
Maximum number of allowed overlaps. |
labelPadding |
Amount of padding around label. |
boxPadding |
Amount of padding around box. |
labelSegWidth |
Thickness of segment connecting label to point. |
legendPos |
Legend position. Choose between 'right' and 'none'. |
legendTextSize |
Legend text size. |
legendTitleSize |
Legend title size. |
axisTextSize |
Axis text size. |
axisTitleSize |
Axis title size. |
verbose |
Whether output should be verbose. |
... |
Additional arguments passed to |
An object of class gg.
x <- c(1, 2, 3, 4, 6, 7, 8, 10, 12, 11, 3, 6, 4, 1, 13, 13, 14, 18, 16)
y <- c(1, 3, 1, 4, 3, 2, 8, 2, 1, 11, 8, 8, 10, 14, 13, 11, 11, 12,15)
z <- round(runif(19, 75, 100), 2)
df <- data.frame(x, y, z)
rownames(df) <- paste0('p', rownames(df))
densityPlot(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.