diff --git a/wsim-gldas-vis.qmd b/wsim-gldas-vis.qmd index 6b34644..1f9866a 100644 --- a/wsim-gldas-vis.qmd +++ b/wsim-gldas-vis.qmd @@ -196,8 +196,13 @@ df_wsim_gldas_1mo <-as.data.frame(wsim_gldas_1mo, xy = TRUE) ggplot2::ggplot(data = df_wsim_gldas_1mo) + ggplot2::geom_raster(ggplot2::aes(x = x, y = y, fill = deficit)) + - ggplot2::scale_color_gradientn( - colors = c('darkred', 'red', 'darkorange', 'orange', 'gold', 'yellow', 'white')) + + #ggplot2::scale_color_gradientn( + #colors = c('darkred', 'red', 'darkorange', 'orange', 'gold', 'yellow', 'white')) + + scale_fill_viridis_c() + + theme_void() + + theme( + legend.position = "bottom" + ) ggplot2::facet_wrap(time ~ .) @@ -219,11 +224,10 @@ Visualize an individual cell with particular extreme or maybe volatile values. U Create a vector with the point location. ```{r} -# coordinates for Austin, Texas +# vector of coordinates for Austin, Texas coords <- c(-97.7431, 30.2672) -# create a stars object with point coordinates where -# st_sfc(), st_points(), st_crs(),st_dimensions() +# create a stars object with point coordinates where 'sf::st_sfc()' is used to create a geometry list column and add a coordinate reference system. 'sf::st_points()' is within that function to turn the coords vector into a point. 'stars:: st_crs()' and 'stars::st_dimensions()' respectively retrieves the coordinate reference system and the dimensions of wsim_gldas_1mo to ensure that the final values in point_stars is the same reference system and shape. point_stars <- sf::st_sfc(st_point(coords), crs = stars::st_crs(wsim_gldas_1mo), dim = names(stars::st_dimensions(wsim_gldas_1mo)))