Description Usage Arguments See Also Examples
View source: R/fct_stats_plotly.R
This is a wrapper of ggplot2::scale_fill_manual()
and
ggplot2::scale_color_manual()
to set two colors for comparing series.
1 2 3 4 5 6 7 8 9 10 | gg_scale_compare(
type = c("fill", "color"),
name = "",
base_id = "Origin",
compare_id = "Select",
base_color = "seagreen",
compare_color = "red",
base_label = base_id,
compare_label = compare_id
)
|
type |
A character of setting type, "fill" for
ggplot2::scale_fill_manual, "color" for |
name |
A character of name to display in title of legend box. |
base_id |
A character of name for base series. |
compare_id |
A character of name for comparing series. |
base_color |
A character of color for base series. |
compare_color |
A character of color for comparing series. |
base_label |
A character of label for base series to display in legend. default is base_id. |
compare_label |
A character of label for comparing series to display in legend. default is compare_id. |
Other stats_plotly:
stats_plotly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
p <- ds_vars %>%
ggplot(aes(x = ~QR)) +
gg_scale_compare(
type = "fill",
base_id = "Origin", compare_id = "Select"
) +
labs(y = NULL)
# Add original plot
p <- p +
geom_histogram(
aes(fill = "Origin"),
color = NA
)
# Add comparing plot
p <- p +
geom_histogram(
data = ds_vars_compare,
aes(fill = "Select"), color = NA,
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.