Hi R-community,
I am able to do a contour plot, and a map separately, but having some
issues overlaying them. The script and data is attached.
test_filled_contour_plot.png is the contour plot alone
test_ggmap.png is the map alone.
test_overaly.png is supposed to overaly the two, but as you can see,
it's not happening for some reason.
Any suggestions?
Cheers,
Jatin
-------------- next part --------------
# Always delete everything first
rm(list = ls())
library(rgdal)
# load processed AERMOD outputs generated by read_AERMOD_save.R
load("ALL_HOURLY_NOX_Processed")
utmcoor<-SpatialPoints(cbind(x,y), proj4string=CRS("+proj=utm +zone=50 +ellps=WGS84 +south"))
longlatcoor<-spTransform(utmcoor,CRS("+proj=longlat"))
lon <-longlatcoor at coords[,1]
lat <-longlatcoor at coords[,2]
png("test_filled_countour_plot.png")
filled.contour(x=lon,y=lat,max_conc)
dev.off()
library(ggmap)
pngMAP_df = get_map(location = c(min(lon), min(lat), max(lon), max(lat)), source = "osm", zoom = 12,filename="test_ggmap")
ggmap(pngMAP_df) + filled.contour(x=lon,y=lat,max_conc)
ggsave("test_overlay.png")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_filled_countour_plot.png
Type: image/png
Size: 58183 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20161209/a646360a/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_ggmap.png
Type: image/png
Size: 1636781 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20161209/a646360a/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_overlay.png
Type: image/png
Size: 1865369 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20161209/a646360a/attachment-0005.png>
issue overlaying a contour plot on map
2 messages · Jatin Kala, Jim Lemon
Hi Jatin, It looks as though the third plot has the contour plot beneath the map, which is opaque.If you just want to show the three "hotspots" on the map, perhaps you could adjust the colors so that they are displayed on a transparent field instead of blue and then overlay that on the map. Jim
On Fri, Dec 9, 2016 at 7:02 PM, Jatin Kala <jatin.kala.jk at gmail.com> wrote:
Hi R-community, I am able to do a contour plot, and a map separately, but having some issues overlaying them. The script and data is attached. test_filled_contour_plot.png is the contour plot alone test_ggmap.png is the map alone. test_overaly.png is supposed to overaly the two, but as you can see, it's not happening for some reason. Any suggestions? Cheers, Jatin
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.