I have this code:
library(echarts4r)
iris |>
dplyr::group_by(Species) |>
e_charts(Sepal.Length) |>
e_scatter(Petal.Length, symbol_size = 5) |>
e_tooltip()
How to insert ellipses with color opacity in groups?
Something like:
I have this code:
library(echarts4r)
iris |>
dplyr::group_by(Species) |>
e_charts(Sepal.Length) |>
e_scatter(Petal.Length, symbol_size = 5) |>
e_tooltip()
How to insert ellipses with color opacity in groups?
Something like:
Copyright © 2021 Jogjafile Inc.
You can use the
stat_ellipse
function:We can use this example to perform a Linear Discriminant Analysis in R, similar to yours and easy to reproduce with the code here.
Then, you can use
ggplot
andstat_ellipse
function, as already suggested,and to vary the opacity of the ellipse's color as you wish, you can change the
alpha
value, 1 for very opaque and 0 for transparent,such as,
I hope I have answered your question