ggfocus | R Documentation |
'ggfocus()' is deprecated. Add focus scales with 'scale_color_focus()', 'scale_fill_focus()', 'scale_alpha_focus()', ... instead.
Creates a 'ggplot' object with focus scales from another 'ggplot' object.
ggfocus( p, var, focus_levels, focus_aes = c("color", "alpha", "fill"), color_focus = NULL, color_other = "black", alpha_focus = 1, alpha_other = 0.05 )
p |
a 'ggplot' object. |
var |
Sets. |
focus_levels |
levels to be highlited. |
focus_aes |
list of aesthetics used to highlight. "color","alpha" and "fill" are available. |
color_focus |
vector of colors (or a single color) for focused levels. |
color_other |
color for non-focused levels. |
alpha_focus, alpha_other |
alpha value for focused and non-focused levels. |
a ggplot object with focusing scales.
Victor Freguglia
library(ggplot2) p <- ggplot(iris,aes(x=Sepal.Length,y=Petal.Length)) + geom_point() ggfocus(p, Species, "versicolor")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.