服务热线
178 0020 3020
library(maptools)
library(sp)
library(ggplot2)
library(rgdal)
library(plyr)
china_map<- readOGR("bou2_4p.shp")
x<-china_map@data
xs<- data.frame(x,id=seq(0:924)-1)
china_map1<- fortify(china_map)
china_mapdata<- join(china_map1,xs,type="full")
xinjiang_data<- subset(china_mapdata,NAME=="新疆维吾尔自治区")
head(xinjiang_data)
B<-ggplot(xinjiang,aes(x=long,y=lat,group=group,fill=NAME))+
geom_polygon(fill="yellow")+
geom_path(color="grey40")+
ggtitle("R2-33")+
geom_point(x=87.36,y=43.48,fill="red")+
annotate("text",x=87.36,y=43.8,label="乌鲁木齐市");B
theme<-theme( panel.background=element_blank(),
panel.grid=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank(),
axis.title=element_blank(), legend.position = "none")
B+theme
library(maptools)
library(sp)
library(ggplot2)
library(rgdal)
library(plyr)
china_map<- readOGR("bou2_4p.shp")
x<-china_map@data
xs<- data.frame(x,id=seq(0:924)-1)
china_map1<- fortify(china_map)
china_mapdata<- join(china_map1,xs,type="full")
mydata<-read.csv("R2-9-1.csv")
head(mydata)
data<-join(china_mapdata,mydata,type="full")
theme<-theme( panel.background=element_blank(),
panel.grid=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank(),
axis.title=element_blank())
C<- ggplot(data,aes(x = long, y = lat, group = group,fill=pop))+
geom_polygon()+
scale_fill_gradient(low="white",high="red")+
geom_path(colour = "green")+
ggtitle("R2-33")
C+theme
附件