服务热线
178 0020 3020
> library(gcookbook)
> library(ggplot2)
> supp1=c("OJ","OJ","OJ","VC","VC","VC")
> dose1=c(0.5,1.0,2.0,0.5,1.0,2.0)
> length1=c(13.23,22.70,26.06,7.98,16.77,26.14)
> tgg=data.frame(supp1,dose1,length1)
ggplot(tgg, aes(x=dose1, y=length1, color=supp1,shape=supp1)) +geom_line(position=position_dodge(0.2)) +geom_point(position=position_dodge(0.2),size=4)
> p<-ggplot(tgg, aes(x=dose1, y=length1, color=supp1,shape=supp1)) +geom_line(position=position_dodge(0.2)) +geom_point(position=position_dodge(0.2),size=4)
> p+ggtitle('R2-28') +theme_bw()
> library(ggplot2)
> attach(midwest)
> class(midwest)
> Midwest
>ggplot(midwest,aes(x = area, y =poptotal,colour = state))+geom_point()
> p<-ggplot(midwest,aes(x = area, y =poptotal,colour = state))+geom_point()
> p+geom_point(aes(col=state,size=popdensity))
> h<- p+geom_point(aes(col=state,size=popdensity))
> h+geom_smooth(method=”loess”,se=F)
> h+geom_smooth(method="loess",se=F)
> w<-h+geom_smooth(method="loess",se=F)
w+labs(subtitle="Area Vs Population",y="Population",x="Area",title="R2-28",caption="source:midwest")
> q<-w+labs(subtitle="Area Vs Population",y="Population",x="Area",title="R2-28",caption="source:midwest")
> q+xlim(c(0,0.1))+ylim(c(0,500000))
> library(ggplot2)
> library(reshape2)
> library(plyr)
> library(scales)
> data<- read.csv(file.choose())
> data
> mydata<- melt(data,id.vars=c("Name"))
> mydata2<-ddply(mydata,.(variable), transform,label=rescale(value))
> ggplot(mydata2, aes(x=variable,y=Name))+geom_tile(aes(fill=label))+scale_fill_gradient(low = "yellow", high = "red")+xlab("Groups")
> p<- ggplot(mydata2, aes(x=variable,y=Name))+geom_tile(aes(fill=label))+scale_fill_gradient(low = "yellow", high = "red")+xlab("Groups")
> p+ ggtitle("R2-28")
附件