View source: R/geom-histogram-rounded.R
| geom_histogram_rounded | R Documentation |
Create a histogram with rounded corners using
'ggplot2'. geom_histogram_rounded() is an extension of the
ggplot2::geom_histogram() function and uses the same binning
parameters as ggplot2::stat_bin() while drawing bars with rounded
corners.
geom_histogram_rounded(
mapping = NULL,
data = NULL,
position = "stack",
radius = 0.2,
...,
binwidth = NULL,
bins = NULL,
center = NULL,
boundary = NULL,
closed = c("right", "left"),
pad = FALSE,
breaks = NULL,
drop = "none",
orientation = NA,
na.rm = FALSE,
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 |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
radius |
A normalized rounding amount between 0 and 1. Use |
... |
Other arguments passed on to |
binwidth |
The width of the bins. The default uses 30 bins that cover the range of the data. You should usually override this value, exploring multiple widths to find the best to illustrate the stories in your data. |
bins |
Number of bins. Overridden by |
center, boundary |
Bin position specifiers passed to
|
closed |
One of |
pad |
If |
breaks |
A numeric vector of bin boundaries. |
drop |
Controls whether empty bins are dropped. Passed to
|
orientation |
The orientation of the layer. Passed to
|
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
A ggplot object.
library(ggplot2)
ggplot(faithful, aes(waiting)) +
geom_histogram_rounded()
ggplot(faithful, aes(waiting)) +
geom_histogram_rounded(bins = 10, radius = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.