Created
February 28, 2014 16:49
-
-
Save mickeypash/9274620 to your computer and use it in GitHub Desktop.
can anyone tell me how to imporve this plot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load(file="preprocessed.RData") | |
load(file="alldat.RData") | |
colnames(alldat) <- sub("\\.x$", "", colnames(alldat)) | |
rownames(alldat) <- NULL | |
mx <- as.matrix(xtabs(~AOI+Msec, alldat)) | |
props <- mx / apply(mx, 2, sum) | |
# Use ggplot to make it cool? | |
bins <- seq(0,1488,24) | |
pdf(file="plot-line.pdf",height=6,width=6) | |
plot(bins, rep(NA, length(bins)), | |
ylim=c(0,1), type='l', xlab="Time from Onset (ms)", | |
ylab="Probability of Gaze Latency") | |
lineinfo <- list(PComp=list(mpch=1,mcol='blue'), | |
SComp=list(mpch=2,mcol='green'), | |
Targ=list(mpch=3,mcol='red'), | |
Unrl=list(mpch=4,mcol='gray50')) | |
colors <- rainbow(4, alpha=.5) | |
lapply(rownames(props), function(x) { | |
inf <- lineinfo[[x]] | |
#points(bins, props[x,], type='b', pch=inf$mpch, col=inf$mcol) | |
points(bins, props[x,], type='l', col=y, xlim=c(0,1400)) | |
},colors) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment