Gauge the variables (aspects
) used to define axis
and grid of the plot.
gauge( g, asp, ..., nice = TRUE, range = NULL, min = NULL, max = NULL, min_limit = NULL, max_limit = NULL, alias = NULL, tick_count = NULL, max_tick_count = NULL ) gauge_x_time(g, ..., show_last = FALSE) gauge_y_time(g, ..., show_last = FALSE) gauge_x_linear(g, ..., tick_interval = NULL) gauge_y_linear(g, ..., tick_interval = NULL) gauge_x_cat(g, ...) gauge_y_cat(g, ...) gauge_x_time_cat(g, ...) gauge_y_time_cat(g, ...) gauge_x_log(g, ..., base = 10) gauge_y_log(g, ..., base = 10) gauge_x_pow(g, ...) gauge_y_pow(g, ...) gauge_x_quantile(g, ...) gauge_y_quantile(g, ...) gauge_x_quantize(g, ...) gauge_y_quantize(g, ...) gauge_x_identity(g, ...) gauge_y_identity(g, ...) gauge_asp(g, ...)
g | An object of class |
---|---|
asp | Bare column name of aspect to apply the gauge to. |
... | Options to gauge variables
( |
nice | Automatically adjust |
range | A vector of length 2 giving the minimum, and maximum. |
min, max | Range of the gauge. |
min_limit, max_limit | Strict range of the ticks. |
alias | Alias name of the gauge and variable to display. |
tick_count | Maximum number of ticks. |
max_tick_count | Maximum number of ticks. |
show_last | Whether to force show the last tick
(only for |
tick_interval | Minimum tick interval, only applies to linear type of gauge. |
base | Base of log. |
cat
: Categorical.
timeCat
: Categorical time.
linear
: Linear.
time
: Date, time, etc.
log
: Logarithmic.
pow
: Exponential.
quantize
: Manual quantiles.
quantile
: Auto-generated quantiles.
identity
: Constant.
g <- g2(cars, asp(speed, dist)) %>% fig_point() g %>% gauge(speed, min = 0) g %>% gauge_y_log(title = "Log") g %>% gauge(dist, tickCount = 10)