r-spatial / stars

Spatiotemporal Arrays, Raster and Vector Data Cubes
https://r-spatial.github.io/stars/
Apache License 2.0
557 stars 94 forks source link

Add geom_stars for ggplot plotting #21

Closed adrfantini closed 2 years ago

adrfantini commented 6 years ago

A while back sf has implemented a geom_sf which provides a ggplot2 plotting interface for sf objects. And it is awesome.

stars imho should also provide something similar.

aloboa commented 2 years ago

is there a way geom_stars() could actually plot a color composite?

edzer commented 2 years ago
st_as_stars(L7_ETMs)[,,,1:3] |> st_rgb() -> x
ggplot() + geom_stars(data = x, fill = as.vector(x[[1]]))

x

aloboa commented 2 years ago

Cool. I suggest including this example in the documentation, perhaps with linear stretching.

edzer commented 2 years ago

Done; the linear stretching is in the docs of st_rgb().