I have a dataframe contains variables named ID
, longitude(LON
),latitude(LAT
) which you can download. I have plotted some longitude-latitude on a country map with different colors for different ID's using ggplot2 package on same map with following code:
gg <- ggplot()
gg <- gg + geom_map(data=skorea, map=skorea,
aes(x=long, y=lat, map_id=id, group=group),
fill=NA, color="black")
gg <- gg + geom_point(data=st, aes(x=LON, y=LAT, color=color),
alpha=1, na.rm=TRUE)
gg <- gg + scale_size(range=c(2,7))
gg <- gg + scale_color_identity()
gg <- gg + labs(title= "coordinate data of id",
x="Longitude", y= "Latitude")
gg <- gg + coord_map()
gg <- gg + theme_map()
gg <- gg + theme(title= element_text(hjust = 0.5, vjust=1, face="bold"))
gg
I wanted to plot Loss_ratio on map in such a way that in usertxt1 i have 3 levels level1, level2, level3 i wanted to plot 3 maps for each of these levels in usertxt1.In each map it should contain corresponding loss ratio with variation in shade of colour like highest value should be darkest and smallest value should be lightest.