Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A good start would be to replicate the plot.stars() method (from https://github.com/r-spatial/stars)
plot.stars()
library(stars) etm <- st_stars(system.file("tif/L7_ETMs.tif", package = "stars")) plot(etm)
So plot_ly(etm) would do something similar to this (automatically)
plot_ly(etm)
library(sf) etm <- st_transform(etm, 3857) band <- st_dimensions(etm)[["band"]] n <- band$to - band$from + 1 ann <- list(x = 0.5, y = 1, yanchor = "bottom", xanchor = "middle", xref = "paper", yref = "paper", showarrow = FALSE) plots <- lapply(seq_len(n), function(i) { z <- t(etm[[1]][,,i]) ann$text <- paste(names(etm), i) plot_ly(z = z[seq.int(nrow(z), 1), ]) %>% layout(annotations = ann) %>% colorbar(title = i) }) subplot(plots, nrows = 2, titleX = TRUE, shareX = TRUE, shareY = TRUE)
cc @jackparmer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A good start would be to replicate the
plot.stars()
method (from https://github.com/r-spatial/stars)So
plot_ly(etm)
would do something similar to this (automatically)cc @jackparmer
The text was updated successfully, but these errors were encountered: