scatterHatch | R Documentation |
This function creates a scatterplot with hatched patterns by using geom_segment(). Also creates the legend to represent each hatched group. The aesthetics defining each pattern, like the lineType and lineColor are all passed to geom_segment().
scatterHatch( data, x, y, color_by, legendTitle = "", pointSize = 1, pointAlpha = 0.5, gridSize = NULL, sparsePoints = NULL, patternList = NULL, colorPalette = NULL )
data |
Dataset to be used |
x |
Column name of x-coordinates |
y |
Column name of y-coordinates |
color_by |
Column name of factor that defines groupings |
legendTitle |
Title of the legend |
pointSize |
Point size for the scatterplot |
pointAlpha |
Transparency of points in the scatterplot |
gridSize |
Controls the precision of the hatched pattern. Larger values correspond to greater precision. Default follows a exponential decay function based on point size. |
sparsePoints |
Logical Vector denoting points annotated as sparse. If NULL, default sparsity detector will be used to annotate sparse points. |
patternList |
Aesthetics to be passed for each pattern (must be a list where each element has a named pattern) |
colorPalette |
Colors to be used for each group. Default is color-blind friendly. |
ggplot2 object of scatterplot with hatched patterns for each group.
data(pdacData) scatterHatch(pdacData, "Xt", "Yt", "frame")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.