View source: R/geom-series-circles.R
geom_series_circles | R Documentation |
geom_series_circles()
can be used as an alternative for
single or multiple bar charts. It consists of using
whole and fragments of circles to represent numerical values.
As it draws circles, the geom should use with ggplot2::coord_equal()
to maintain the "aspect ratio".
There are two are arguments absolutely needed in aes()
mappings:
x
A vector mapping the abscissa axis x
, i.e. a character vector
when x
is a numerical vector, or a numerical vector when y
is a character
vector.
y
A vector mapping the ordinate axis y
, i.e. a numerical vector
when x
is a character vector or vice versa.
There is a default mapping fill
with value black
to fill circles/fragments
of circles with. It can be used in aes
mapping or as a global argument
for all the circles.
geom_series_circles(
mapping = NULL,
data = NULL,
show.legend = NA,
na.rm = FALSE,
inherit.aes = TRUE,
init_angle = 0,
r = 0.5,
color = NA,
linewidth = 0.5,
...
)
mapping |
Set of aesthetic mappings created by |
data |
to be displayed in this layer |
show.legend |
logical. Should this layer be included in the legends?
|
na.rm |
If |
inherit.aes |
If |
init_angle |
Circle drawing starting angle. |
r |
Circle radius, should be <= 0.5. |
color |
Color of circles/fragments of circles borders. |
linewidth |
Size of circles/fragments of circles borders. |
... |
other arguments passed on to |
A ggplot2 layer.
my_df <- data.frame(cat = c("Apple", "Banana", "Pineapple"), val = c(2.65, 4.5, 6.25))
my_df |>
ggplot2::ggplot() +
geom_series_circles(ggplot2::aes(cat, val)) +
ggplot2::coord_equal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.