add_histogram {tidyplots} | R Documentation |
Add histogram
add_histogram(plot, binwidth = NULL, bins = NULL, ...)
plot |
A |
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 |
... |
Arguments passed on to the |
A tidyplot
object.
energy %>%
tidyplot(x = power) %>%
add_histogram()
energy %>%
tidyplot(x = power, color = energy_type) %>%
add_histogram()