y_range: Update y axis range in a Bokeh figure

Description Usage Arguments See Also Examples

View source: R/fig_range.R

Description

Update y axis range in a Bokeh figure

Usage

1
y_range(fig, dat = NULL, callback = NULL)

Arguments

fig

figure to modify

dat

either a vector (min, max) if the axis is numeric, or a vector of values if the axis is categorical. In the latter case, the order in which the values are supplied is how they will be arranged on the axis.

callback

TODO

See Also

Other ranges: x_range()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# get data from Duluth site in 'barley' data
du <- subset(lattice::barley, site == "Duluth")

# plot with default ranges
p <- figure(width = 600) %>%
  ly_points(yield, variety, color = year, data = du)
p
# y axis is alphabetical

# manually set x and y axis (y in order of 1932 yield)
p %>%
  x_range(c(20, 40)) %>%
  y_range(du$variety[order(subset(du, year == 1932)$yield)])

rbokeh documentation built on Aug. 4, 2021, 1:06 a.m.