Description Usage Arguments Value
View source: R/add_lake_contours.R
Given a) a single lake level or a vector of lake levels as well as b) the name of the lake of interest, this loads the raster associated with the lake and draws contours at the desired levels on an existing plot object. Note that by default, each contour is color coded. To turn this off, set color_values to the all the same color (e.g., c("black", "black", "black")) and set legend_position to "none".
1 2 3 4 5 6 7 8 9 | add_lake_contours(
plot_obj,
lake,
lake_levels,
color_legend_title = "Exceedance Probability (%)",
color_labels = c(10, 50, 90),
color_values = c("#a80000", "#ffab00", "#004da8"),
line_size = 0.8
)
|
plot_obj |
existing plot object to add outlines to. |
lake |
name of lake to analyze, e.g., "Long" |
lake_levels |
a single value or vector of lake elevations (mamsl) to draw contors for. |
color_legend_title |
legend title for colors. |
color_labels |
a vector corresponding to lake_levels with the name to use for each level in the legend. Defaults to c(10, 50, 90) for the 10%, 50%, and 90% exceedance probabilities. |
color_values |
a vector corresponding to lake_levels with the color to use for each level in the legend. Defaults to c("#a80000", "#ffab00", "#004da8") for Tuscan Red (#a80000), Electron Gold (#ffab00), and Ultra Blue (#004da8). Note that the order of this vector does not necessarily correspond with the order of lake_levels or color_labels, it may take some trial and error to find the right order for the visualization you have in mind. |
line_size |
size (lineweight) of lake shoreline, defaults to 0.8 |
plot_obj, a plot with the contours of the lake.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.