Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

change border thickness of marked ellipses created using ggforce::geom_mark_ellipse()

I am trying to change the borders of marked ellipses created using ggforce::geom_mark_ellipse(). How can I remove the borders and just keep the filled ellipses? code for reproducibility is provided below.

enter image description here

library(palmerpenguins)
library(tidyverse)
library(ggplot2)
library(ggforce)

penguins <- penguins %>%
  drop_na()
penguins %>% head() %>% print()


p <- penguins %>%
  ggplot(aes(x = bill_length_mm,
             y = flipper_length_mm))+
  geom_mark_ellipse(aes(colour=species, fill = species),
                   expand = unit(0.5,"mm"),
                   show.legend = F)+
  geom_point(aes(color = species))

print(p)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You could remove the outline or set the thickness via size, i.e. size=0 or size=NA will work to remove the outline. Another option would be to set the linetype to blank, i.e. lty = "blank".

library(palmerpenguins)
library(tidyverse)
library(ggplot2)
library(ggforce)

penguins <- penguins %>%
  drop_na()

p <- penguins %>%
  ggplot(aes(x = bill_length_mm,
             y = flipper_length_mm))+
  geom_mark_ellipse(aes(colour=species, fill = species),
                    expand = unit(0.5,"mm"), size = 0,
                    show.legend = F)+
  geom_point(aes(color = species))

print(p)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading