comparison SMC2015latex/R/modelsprediction.R @ 47:4110da08bca9

Refined the diagrams
author csong <csong@eecs.qmul.ac.uk>
date Thu, 23 Apr 2015 23:57:27 +0100
parents 121d0e1f1748
children
comparison
equal deleted inserted replaced
44:144460f34b5e 47:4110da08bca9
1 library(ggplot2) 1 library(ggplot2)
2 2
3 df <- read.csv("newall.csv", header = T) 3 df <- read.csv("newall.csv", header = T)
4 4
5
6 t<-theme( 5 t<-theme(
7 plot.background = element_blank(), 6 plot.background = element_blank(),
8 # panel.grid.major = element_blank(), 7 panel.grid.major = element_blank(),
9 # panel.grid.minor = element_blank(), 8 panel.grid.minor = element_blank(),
10 panel.border = element_blank(), 9 panel.border = element_blank(),
11 panel.background = element_blank(), 10 panel.background = element_blank(),
12 axis.line = element_line(size=.5), 11 axis.line = element_line(size=.5),
13 axis.text.x = element_text(family = "sans", size=10, color = "black"), 12 axis.title.x = element_blank(),
14 axis.text.y = element_text(family = "sans", size=10, color = "black"), 13 axis.title.y = element_blank(),
15 axis.title.x = element_text(family="sans", color="black", size=15, vjust = -0.7), 14 #axis.title.x = element_text(family="sans", color="black", size=15, vjust = -0.7),
16 axis.title.y = element_text(family="sans", color="black", size=15, vjust = 0.4), 15 #axis.title.y = element_text(family="sans", color="black", size=15, vjust = 0.4),
17 legend.position = "none" 16 #legend.position = "none"
18 ) 17 )
19 18
19 xbreaks <- c(1,16,28,64,111)
20 ybreaks <- c(0,1,1.5,2.5,3,4,4.5,5.5,6,7,7.5,8.5,9,10)
20 21
21 p <- qplot(Index,Syncopation, data = df, geom = c("point","line"), color = Model) 22 p <- qplot(Index,Syncopation, data = df, geom = c("point","line"), color = Model)+ scale_x_continuous(breaks=xbreaks) + scale_y_continuous(breaks= ybreaks)+ t
22 p+t 23
24 ggsave(p, file = "predictions.pdf", dpi = 600,useDingbats=FALSE)