setwd("F:\\Dissertation")
data24<-read.csv(file = "24.csv",stringsAsFactors = F)
a<-data24[which(data24$Trt=='R'),]
b<-data24[which(data24$Trt=='T'),]
library(ggplot2)
p1<-ggplot(a,aes(x=Time,y=Con,group=Subj))+geom_point(aes(colour=Subj))+geom_line(aes(colour=Subj),size=0.7)+theme_bw()+labs(title='参比制剂(R)',x='Time (h)',y='Deferasirox concentration(ug/mL)')+scale_color_gradient(low = "red",high = "yellow")+ylim(0,60)
p2<-ggplot(b,aes(x=Time,y=Con,group=Subj))+geom_point(aes(colour=Subj))+geom_line(aes(colour=Subj),size=0.7)+theme_bw()+labs(title='受试制剂(T)',x='Time(h)',y='Deferasirox concentration(ug/mL)')
#p1+scale_color_gradient(low = "yellow",high = "red") 用这种先写p1再加功能上去的方法颜色居然就上去还是老样子,不知道为啥
#p2+scale_color_gradient(low = "blue",high = "red")
# p1+scale_color_brewer(low)
# p2+scale_color_brewer(palette="Set2")
library(gridExtra)
grid.arrange(p1, p2,ncol=2) #把两个图放在一个面板上
