服务热线
178 0020 3020
>install.packages("gcookbook")
> 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)
> fjh=data.frame(supp1,dose1,length1)
ggplot(fjh, 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)
> ggplot(fjh, 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)+theme_bw()+ggtitle("R2-16")
> library(ggplot2)
> attach(midwest)
> class(midwest)
> midwest
>ggplot(midwest,aes(x = area, y =poptotal,colour = state))+geom_point()+geom_point(aes(col=state,size=popdensity))+geom_smooth(method="loess",se=F)+labs(subtitle="Area Vs Population",y="Population",x="Area",title="R2-16",caption="source:midwest")+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 = "blue", high = "green")+xlab("Groups")+ ggtitle("R2-16")
附件