dkahle / dkahle/ggmap

coord_cartesian not working when I add it to my script

Open
#304 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
778
Forks
234
PR merge metrics
No merged PRs in 30d

Description

Hello,

The last line in my code coord_cartesian(xlim=c(-88.69621, -88.32439), ylim = c(17.20181, 17.56456)) is not compatible with the rest of my code. Not sure how to fix this problem.

fire_map <- ggmap(map.us) +
coord_sf(crs = st_crs(4326))+
geom_sf(data = Arshp_4326, size = 2.5, color = "blue", fill = NA, inherit.aes = FALSE)+
geom_polygon(data = US, aes(x = long, y = lat, group = group), size = 0.5,
alpha = 1, linetype = 1, color = "white", fill = NA)+
geom_point(data = as.data.frame(sp),
aes(x = coords.x1, y = coords.x2, color = as.integer(brightness), size = frp),
pch = 16, alpha=0.5)+
scale_color_gradient(low="yellow", high = "red")+
labs(x = "Longitude", y = "Latitude", color = "Fire Brightness",
size = "Fire Radiative Power",
title = "Fire occurences 2010-2020",
subtitle = "Data source: NASA FIRMS MODIS-6 https://firms.modaps.eosdis.nasa.gov")+
theme(legend.background = element_blank(),
legend.key = element_blank(),
legend.position = "bottom",
legend.box = "vertical",
legend.margin=margin(t=, r=0, b=-0.1, l=0, unit="cm"))+
guides(colour = guide_colourbar(title.position="top", title.hjust = 0.5,
barwidth = 20, barheight = 0.8, order = 1),
size = guide_legend(title.position="top", title.hjust = 0.5, byrow = 2, order = 2))+
coord_cartesian(xlim=c(-88.69621, -88.32439), ylim = c(17.20181, 17.56456))

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.