x_range {rbokeh} | R Documentation |
Update x axis range in a Bokeh figure
x_range(fig, dat = NULL, callback = NULL)
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 |
Other ranges: y_range
# 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)])