Title: | Multiple Geometric Shape Point Layer for 'ggplot2' |
---|---|
Description: | To create the multiple polygonal point layer for easily discernible shapes, we developed the package, it is like the 'geom_point' of 'ggplot2'. It can be used to draw the scatter plot. |
Authors: | Shuangbin Xu [aut, cre] |
Maintainer: | Shuangbin Xu <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.0.4.002 |
Built: | 2024-11-04 04:03:53 UTC |
Source: | https://github.com/xiangpin/ggstar |
Each Geom has an associated function that draws the key when the geom needs to be displayed in a legend. These are the options built into ggplot2.
draw_key_star(data, params, size)
draw_key_star(data, params, size)
data |
A single row data frame containing the scaled aesthetics to display in this key |
params |
A list of additional parameters supplied to the geom. |
size |
Width and height of key in mm. |
A grid grob.
geom_star provides the multiple geometric shape to create scatter plot or other point plot, it is like the 'geom_point' of 'ggplot2'. Note: the 'left-triangle' (17, 19) and 'right-triangle' (18, 20) are developed to plot the 'triangle-heatmap'. Their centers are not in their internal, but the center of hypotenuse.
geom_star( mapping = NULL, data = NULL, na.rm = FALSE, stat = "identity", position = "identity", show.legend = NA, inherit.aes = TRUE, ... )
geom_star( mapping = NULL, data = NULL, na.rm = FALSE, stat = "identity", position = "identity", show.legend = NA, inherit.aes = TRUE, ... )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
na.rm |
If 'FALSE', the default, missing values are removed with a warning. If 'TRUE', missing values are silently removed. |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to |
starshape
the shape of point, default is 1 (star shape).
starstroke
control the thickness of margin of point, default is 0.5.
size
the size of point, default is 1.5.
colour
the colour of margin, default is 'black'.
fill
the colour of fill, default is NA.
alpha
the transparency of fill, default is 1.
angle
control the angle of rotation of point, default is 0.
subset
subset the data frame which meet conditions to display.
polygonal point layer
geom_star()
understands the following aesthetics (required aesthetics are in bold):
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
Shuangbin Xu
library(ggplot2) p <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, starshape=Species)) + geom_star(size=4) p
library(ggplot2) p <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, starshape=Species)) + geom_star(size=4) p
Create your own discrete scale
scale_starshape_manual(..., values, aesthetic = "starshape") scale_angle_manual(..., values, aesthetic = "angle")
scale_starshape_manual(..., values, aesthetic = "starshape") scale_angle_manual(..., values, aesthetic = "angle")
... |
Arguments passed on to
|
values |
a set of aesthetic values to map data values to. If this is a named vector, then the values will be matched based on the names. If unnamed, values will be matched in order (usually alphabetical) with the limits of the scale. Any data values that don't match will be given 'na.value'. |
aesthetic |
The names of the aesthetics that this scale works with. |
starshape scale constructor
‘scale_starshape' maps discrete variables to nine easily discernible shapes (’starshapes'). If you have more than 9 levels, you will get a warning message, and the seventh and subsequence levels will not appear on the plot. Use [scale_starshape_manual()] to supply your own values. You can not map a continuous variable to shape.
scale_starshape(..., default = TRUE)
scale_starshape(..., default = TRUE)
... |
Arguments passed on to
|
default |
should the starshapes be default? |
Use values without scaling for ggstar
scale_starshape_identity(..., guide = "none")
scale_starshape_identity(..., guide = "none")
... |
Arguments passed on to
|
guide |
Guide to use for this scale. Defaults to '"none"'. |
identical (default) starshape scale constructor
Show the total star shapes
show_starshapes(...)
show_starshapes(...)
... |
see also |
gg object
Shuangbin Xu
p <- show_starshapes() p
p <- show_starshapes() p
starshape palette (discrete)
starshape_pal(default = TRUE)
starshape_pal(default = TRUE)
default |
should starshapes be reorder (1, 13, 15, 11, 12, 14, 29, 2, 27) or not? |