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

How to change the shapes of the dots in the ggerrorplot

I want to change the shape of the dots in my ggpubr graphic.
My overall aim is that I don’t want to use colors for my print.
I am not so familiar with the ggpubr graphics but I use them for the asteriks.

How can I change the shape of the points? I need 7 different shapes. The input argument
shape = "combi" did not change anything.
So how could I get what I want?

ggerrorplot(subset_PUFA_together, x = "Lipid_Species", y = "isotopic_ratio",
                    add = "mean", error.plot = "errorbar", color = "combi", 
                                                            palette = c( "#009E73","#E69F00","#F0E442",
                                                                       "#0072B2", "#D55E00", "#CC79A7", "#000000"),
                    legend = "right",position = position_dodge(width=0.4),
                    size = 1.4, xlab = "", ylab = "") 

Thanks,
Nadine

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

PS:
Some data for playing around:

structure(list(Lipid_Species = structure(c(3L, 3L, 2L, 2L, 3L, 
6L, 4L, 6L, 2L, 5L), .Label = c("LIN", "ALA", "SDA", "EPA", "ARA", 
"DHA"), class = "factor"), isotopic_ratio = c(NA, -47.8432292, 
-40.4566585, -43.2375195, NA, NA, -41.1712774, NA, -38.7533203, 
-45.66419779), combi = structure(c(3L, 4L, 5L, 3L, 2L, 1L, 7L, 
2L, 2L, 3L), .Label = c("Fresh leaves", "Submerged leaves", "Epilithon", 
"Emphemeroptera (Grazer)", "Plecoptera (Shredder)", "Gammarus (Shredder)", 
"Plecoptera (Predator)"), class = "factor")), row.names = c(13802L, 
13874L, 71L, 4L, 14551L, 4956L, 5993L, 4921L, 779L, 887L), class = "data.frame")

>Solution :

If you change the add to jitter you can change the shape like this:

library(ggpubr)
  ggerrorplot(subset_PUFA_together, x = "Lipid_Species", y = "isotopic_ratio",
              add = "jitter", error.plot = "errorbar", color = "combi", 
              palette = c( "#009E73","#E69F00","#F0E442",
                           "#0072B2", "#D55E00", "#CC79A7", "#000000"),
              legend = "right",position = position_dodge(width=0.4),
              size = 1.4, xlab = "", ylab = "", add.params=list(shape = "combi")) 

Output:

enter image description here

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