geom_hist_bw | R Documentation |
A wrapper for ggplot2::geom_histogram()
that sets color
to black
and fill
to white
.
geom_hist_bw(
mapping = NULL,
data = NULL,
position = "stack",
color = "black",
fill = "white",
...,
binwidth = NULL,
bins = NULL,
na.rm = FALSE,
orientation = NA,
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 |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
color |
Histogram color. Defaults to |
fill |
Histogram fill. Defaults to |
... |
Other arguments passed on to
|
binwidth |
The width of the bins. Can be specified as a numeric value
or as a function that calculates width from unscaled x. Here, "unscaled x"
refers to the original x values in the data, before application of any
scale transformation. When specifying a function along with a grouping
structure, the function will be called once per group.
The default is to use the number of bins in The bin width of a date variable is the number of days in each time; the bin width of a time variable is the number of seconds. |
bins |
Number of bins. Overridden by |
na.rm |
If |
orientation |
The orientation of the layer. The default ( |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
library(ggplot2)
ggplot(mpg, aes(hwy)) +
geom_hist_bw(binwidth = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.