attach_key: View bivariate histograms with their keys

Description Usage Arguments Value Examples

View source: R/attach_key.R

Description

View bivariate histograms with their keys

Usage

1
attach_key(plot, VizuKey, draw = TRUE)

Arguments

plot

a plot such as those returned from st_bivariate_histogram()

VizuKey

a key built with Vizumap::build_bkey()

draw

should the plot be drawn on the current device (default)? if FALSE, returns a grob without drawing. See gridExtra::arrangeGrob()

Value

draws on the current device or returns a grob

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Preparing the data
out <- st_assign_colors(tmax, 1, tmin, 1, terciles = FALSE)
data <- out$data
colors <- out$colors
bounds <- out$bounds

# generating and plotting the histogram
bvh <- st_bivariate_histogram(data = data,
            title = "Max/Min temperature distribution")
bvh

# creating and attaching the key
key <- Vizumap::build_bkey(data, colors, terciles = TRUE)
Vizumap::view(key)
attach_key(bvh, key)

JamesMCollier/densityviz documentation built on Dec. 18, 2021, 12:31 a.m.