why appear center point when use geom_jitter and geom_point?

Hi everyone
I am trying to make this graph and I do not understand why a square figure appears in the center of each area (highlighted). Maybe it can be improved a little.

image

ggplot(data = d, aes(x = zona, y = Parasitoide,
                     fill = Hospedero,
                     color=Parasitoide,
                     shape = Hospedero
                     )) +
    geom_point(alpha=0.5) +
    geom_jitter() +
    theme_bw()+
    scale_shape_manual(values=c(4, 15, 16, 17, 10)) +
    scale_fill_manual(values=c("#2D419D","#FFD163","#620862","#BFDE2A","#1A8A8A"))+
    labs(title="Title", x="", y="",
            caption="Reference")

d<-
structure(list(trat = c("T2", "T2", "T3", "T2", "T3", "T1", "T1",
"T1", "T1", "T3", "T2", "T2", "T1", "T1", "T3", "T2", "T2", "T3",
"T1", "T2", "T3", "T2", "T2", "T1", "T2", "T3", "T1", "T2", "T2",
"T3", "T2", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1",
"T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1",
"T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1", "T1",
"T2", "T2", "T2", "T2", "T2", "T2", "T2", "T2", "T2", "T2", "T2",
"T2", "T2", "T2", "T3", "T3", "T3", "T3", "T3", "T3", "T3"),
zona = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3), Hospedero = c("D. tabernella",
"D. tabernella", "D. busckella", "D. busckella", "D. tabernella",
"D. tabernella", "D. tabernella", "D. busckella", "D. tabernella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. tabernella", "D. busckella", "D. busckella", "D. tabernella",
"D. tabernella", "D. tabernella", "D. tabernella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. indigenella",
"D. indigenella", "D. indigenella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. indigenella", "D. saccharalis", "D. busckella",
"D. saccharalis", "D. busckella", "D. tabernella", "D. tabernella",
"D. busckella", "D. tabernella", "D. indigenella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. saccharalis", "D. tabernella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. indigenella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella", "D. busckella", "D. busckella",
"D. busckella", "D. busckella"), Parasitoide = c("Genea jaynesi",
"Genea jaynesi", "Lydella minense", "Genea jaynesi", "Lydella minense",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Lydella minense", "Genea jaynesi", "Genea jaynesi",
"Cotesia flavipes", "Cotesia flavipes", "Lydella minense",
"Genea jaynesi", "Genea jaynesi", "Lydella minense", "Cotesia flavipes",
"Genea jaynesi", "Lydella minense", "Genea jaynesi", "Genea jaynesi",
"Cotesia flavipes", "Genea jaynesi", "Lydella minense", "Cotesia flavipes",
"Genea jaynesi", "Genea jaynesi", "Lydella minense", "Genea jaynesi",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Cotesia flavipes", "Cotesia flavipes",
"Cotesia flavipes", "Genea jaynesi", "Genea jaynesi", "Genea jaynesi",
"Genea jaynesi", "Genea jaynesi", "Genea jaynesi", "Genea jaynesi",
"Genea jaynesi", "Genea jaynesi", "Genea jaynesi", "Genea jaynesi",
"Genea jaynesi", "Genea jaynesi", "Genea jaynesi", "Lydella minense",
"Lydella minense", "Lydella minense", "Lydella minense",
"Lydella minense", "Lydella minense", "Lydella minense"),
Estado = c("Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada", "Parasitada",
"Parasitada", "Parasitada", "Parasitada", "Parasitada")), row.names = c(NA,
-83L), class = c("tbl_df", "tbl", "data.frame"))

Many Thanks

So I ran your example and I got this:

If you look closely we have "x" and "square" on those coordinates. There is no specific reason why the "squares" are being favoured over the others. They are just more clearly shown on the graph.

Technically your graph actually looks like this as the "jitter" is adding some noise to get the points to spread out slightly more. So in some respects, those points that are most center are in fact closest to the what should be present in the data given that is in fact their true measured value.

2 Likes

Ok Grey, I'm understand. I'm not know this things about geom_jitter(). Tnks you.

1 Like

Most welcome! If it sufficiently solved your problem feel free to mark it as the solution.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.