You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 8, 2019. It is now read-only.
# The breaks has a dummy 1000 in it, to capture any large values above the# scaled maximum of 20 (it works for plotting rasters).# In ggplot, you can use the gradientn to give it any sequence of colours, but# you have to give it values scaled between 0,1. When I scaled pal$breaks that# meant it spread out the range in the big gap between 20 and 1000, so I have to# drop that. Here x is longitude, y is latitude, and "chl" is standard# MODISA/SeaWiFS chlorophyll-a conc:### this is close## chl a data frame of x, y, chl
names(chl) <-"chl"chl[chl>20] <-20
ggplot(as.data.frame(chl, xy=TRUE) %>% dplyr::filter(!is.na(chl)), aes(x, y)) + geom_raster(aes(fill=chl)) + scale_fill_gradientn(values=scales::rescale(head(pal$breaks, -1)), colours=pal$cols)
Primarily, to answer "why not ggdal::coord_proj"? This a raster, and coord_proj must assume long lat input, and there's no way to draw a projected grid like this, I believe the transformation happens after the geoms are set up (keen to be proved wrong!).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A rhetorical question, but should be interesting to explore different approaches.
How would you make this map?
The chlorophyll-a data:
The chlorophyll-a palette (breaks and colours):
The projection and extents:
xx <- c(0, 90, 180, 270, 360); yy <- c(-60, -40)
"+proj=laea +lat_0=-90 +lon_0=180 +datum=WGS84 +ellps=WGS84 +no_defs +towgs84=0, 0, 0"
The fronts are from
orsifronts::orsifronts
:The text was updated successfully, but these errors were encountered: