1

I have a very specific problem: basically I have 2000 points on a plot that are stratified in 4 groups of unequal size. I need to illustrate group, BUT I cannot use colour or shape of the points. Instead I want to draw an oval that encompases say 90% of the data. Is there a function for this?

Pavel Shliaha
  • 773
  • 5
  • 16
  • Possible duplicate: [here](https://stackoverflow.com/questions/2397097/how-can-a-data-ellipse-be-superimposed-on-a-ggplot2-scatterplot) and [here](https://stackoverflow.com/questions/36609476/ggplot2-draw-individual-ellipses-but-color-by-group). – eipi10 Sep 06 '17 at 21:26
  • yes this is similar. Unfortunately I need two color schemes: one for the points and one for the elipses. However when I try to make color scheme for the elipse it supresses color scheme for the points. Is it even possible to have 2 color scheme and 2 legends for 2 different geoms? – Pavel Shliaha Sep 06 '17 at 22:05
  • Use a a filled marker for the points (e.g., `shape=21` or any value from 21-25) an then use a fill aesthetic for the points and a color aesthetic for the ellipses. – eipi10 Sep 06 '17 at 22:06
  • Yep it works! Thanks – Pavel Shliaha Sep 06 '17 at 22:16

0 Answers0