rbokeh (version 0.5.0)

y_range: Update y axis range in a Bokeh figure

Description

Update y axis range in a Bokeh figure

Usage

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

Run this code
# NOT RUN {
# 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)])
# }

Run the code above in your browser using DataCamp Workspace