Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Join data points on boxplot with lines ggplot2

$
0
0

I'm trying to visualize paired sets of data points on the following graphs:

ggplot(grid.mag.ROIcontrols.allRuns, aes(Model,Grid_Magnitude)) +
  geom_boxplot(aes(fill=Model),outlier.shape = NA,alpha=0.6) +
  geom_point(aes(fill=Model),size=2,shape=21,position=position_jitterdodge(0.2)) +
  geom_line(aes(group=Side)) +
  facet_grid(~Side,scales = "free") +
  scale_fill_brewer(palette="GnBu") +
  labs(title = "Average Grid Magnitude, pm vs al EC")

Lines are joining the points between alLeft6/pmLeft6 and between alRight6/pmRight6.

However geom_line with the group variable that I need doesn't work - it adds vertical lines and one horizontal line between data points, when I need one horizontal line for each of the 10 pairs.

Without geom_line: without geom_line

With geom_line: with geom_line

PS: Sorry, I don't know how to share the raw data...


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>