Hi all,We have imported EEG data into R to plot event-related potentials using ggplot2. We have obtained beautiful graphs beating out all further attempts using other software. Using facet_wrap() we also manage to plot the ERPs from all of our 32 electrodes at once (see attachment for a rough example).Now our question is whether there is a neat way in ggplot2 or R base graphics how we could arrange the individual electrode subgraphs such that they approximately reflect the topographical electrode layout on the head? (Just like in the typical ERP top view plots you would get from your dedicated EEG software). Sorting the subgraphs for usage with facet_wrap() obviously won't do the job here.Is there a way to make up a "plotting canvas" and position the subgraphs to specific coordinates of that canvas? Any other suggestions?Thank you for any hints!Sebastian GeukesUniversity of Münster, Germany--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi all,We have imported EEG data into R to plot event-related potentials using ggplot2. We have obtained beautiful graphs beating out all further attempts using other software. Using facet_wrap() we also manage to plot the ERPs from all of our 32 electrodes at once (see attachment for a rough example).Now our question is whether there is a neat way in ggplot2 or R base graphics how we could arrange the individual electrode subgraphs such that they approximately reflect the topographical electrode layout on the head? (Just like in the typical ERP top view plots you would get from your dedicated EEG software). Sorting the subgraphs for usage with facet_wrap() obviously won't do the job here.Is there a way to make up a "plotting canvas" and position the subgraphs to specific coordinates of that canvas? Any other suggestions?Thank you for any hints!Sebastian GeukesUniversity of Münster, Germany--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
# read electrode positions
EPos <- read.table("2D-Positions.txt")
# define plot function
plots <- llply(titles, function(x) ggplotGrob(ggplot([...])))
# run plotting loop (plots contain no axis labels for visual clarity)
grid.newpage()
for (i in 1:length(Electrodes)) {
pushViewport(vp = viewport(EPos$X[i], EPos$Y[i], plotsize, plotsize))
grid.draw(plots[[i]])
popViewport()
}
# add one axis labeling plot
pushViewport(vp = viewport(0.85, 0.12, plotsize, plotsize))
grid.draw(ggplotGrob(ggplot([...])))
popViewport()