Writes the hillshaded map to file.
save_png(
hillshade,
filename,
title_text = NA,
title_offset = c(20, 20),
title_color = "black",
title_size = 30,
title_font = "sans",
title_style = "normal",
title_bar_color = NA,
title_bar_alpha = 0.5,
title_just = "left",
rotate = 0,
asp = 1
)
Array (or matrix) of hillshade to be written.
String with the filename. If .png
is not at the end of the string, it will be appended automatically.
Default NULL
. Text. Adds a title to the image, using magick::image_annotate()
.
Default c(20,20)
. Distance from the top-left (default, gravity
direction in
image_annotate) corner to offset the title.
Default black
. Font color.
Default 30
. Font size in pixels.
Default sans
. String with font family such as "sans", "mono", "serif", "Times", "Helvetica",
"Trebuchet", "Georgia", "Palatino" or "Comic Sans".
Default normal
. Font style (e.g. italic
).
Default NA
. If a color, this will create a colored bar under the title.
Default 0.5
. Transparency of the title bar.
Default left
. Position of the title.
Default 0. Rotates the output. Possible values: 0, 90, 180, 270.
Default 1
. Aspect ratio of the resulting plot. Use asp = 1/cospi(mean_latitude/180)
to rescale
lat/long at higher latitudes to the correct the aspect ratio.
filename_map = tempfile()
#Save the map into `filename_map`
montereybay %>%
sphere_shade() %>%
save_png(filename_map)
#Rotate the map 180 degrees:
montereybay %>%
sphere_shade() %>%
save_png(filename_map,rotate=180)