You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
499 B
24 lines
499 B
library(ggeconodist)
|
|
|
|
ggplot(mammogram_costs, aes(x = city)) +
|
|
geom_econodist(
|
|
aes(ymin = tenth, median = median, ymax = ninetieth),
|
|
stat = "identity",
|
|
) -> gg
|
|
|
|
gb <- ggplotGrob(gg)
|
|
|
|
expect_true(inherits(gb, "gtable"))
|
|
expect_true(identical(dim(gb$layout), c(18L, 7L)))
|
|
|
|
add_econodist_legend(
|
|
gg,
|
|
econodist_legend_grob(
|
|
tenth_col = "#b07aa1",
|
|
ninetieth_col = "#591a4f",
|
|
),
|
|
below = "subtitle",
|
|
just = "right"
|
|
) -> gt
|
|
|
|
expect_true("econodist-legend" %in% gt$layout$name)
|
|
|