tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.06k stars 214 forks source link

asp argument does not work for plot_map() #295

Closed paocorrales closed 11 months ago

paocorrales commented 11 months ago

Hi, I tried to change the aspect ratio of a plot using the asp argument of plot_map() but it seems it doesn't do anything to the plot.

Here is an example using the examples from the documentation of plot_map()

library(rayshader)

water_palette = colorRampPalette(c("darkblue", "dodgerblue", "lightblue"))(200)
bathy_hs = height_shade(montereybay, texture = water_palette)

montereybay %>%
  sphere_shade(zscale=10) %>%
  add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0))  %>%
  add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
  plot_map()


montereybay %>%
  sphere_shade(zscale=10) %>%
  add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0))  %>%
  add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
  plot_map(asp = 1/2)

Created on 2023-11-23 with reprex v2.0.2

tylermorganwall commented 11 months ago

Thanks for the report! This was an upstream rayimage bug: update the rayimage package to the latest version (v0.10.0) to fix:

remotes::install_github("tylermorganwall/rayimage")
tylermorganwall commented 11 months ago

Alternatively, install the binary from r-universe:

install.packages('rayimage', repos = c('https://tylermorganwall.r-universe.dev', 'https://cloud.r-project.org'))