ggplot2-scales {jmastats} | R Documentation |
Scales to use for ggplot2
Description
Usage
scale_color_jma_absolute(type = "precipitation", ...)
scale_color_jma_relative(type = "amedas", ...)
scale_fill_jma_absolute(type = "precipitation", ...)
scale_fill_jma_relative(type = "amedas", ...)
Arguments
type |
Display item |
... |
Arguments to pass on to ggplot2::scale_color_gradientn or ggplot2::scale_fill_gradientn |
Value
A ScaleContinuous
object that can be added to a ggplot
object
Examples
d <-
data.frame(
date = as.Date(c(17410, 17411, 17412, 17413, 17414, 17415), origin = "1970-01-01"),
precipitation_sum = units::set_units(c(3.5, 9.5, 0, 0, 0, 5), "mm"))
library(ggplot2)
library(units)
ggplot(d, aes(date, precipitation_sum,
color = drop_units(precipitation_sum),
fill = drop_units(precipitation_sum))) +
geom_bar(stat = "identity") +
scale_color_jma_absolute(type = "precipitation") +
scale_fill_jma_absolute(type = "precipitation")
[Package jmastats version 0.2.1 Index]