ticker_date {rbokeh}R Documentation

Generate nice ticks across different date and time scales.

Description

Generate nice ticks across different date and time scales.

Usage

ticker_date(desired_num_ticks = 6L, num_minor_ticks = 0L, clear = FALSE)

Arguments

desired_num_ticks

A desired target number of major tick positions to generate across the plot range. Note: This value is a suggestion, and ticker subclasses may ignore it entirely, or use it only as an ideal goal to approach as well as can be, in the context of a specific ticking strategy.

num_minor_ticks

The number of minor tick positions to generate between adjacent major tick values.

clear

A logical indicating whether all non-specified parameters should be cleared out of any exising specification in the figure. This can be useful when modifying a previously-defined figure.

Value

A specification that is used as the ticker argument for x_axis or y_axis.

Examples

figure(width = 1000) %>%
  ly_lines(date, co2, data = co2_df) %>%
  x_axis(ticker = ticker_date(desired_num_ticks = 20))

figure(width = 1000) %>%
  ly_lines(date, co2, data = co2_df) %>%
  x_axis(tickformatter = tickformatter_date(year = "'%y"))

figure() %>%
  ly_points(Sys.time() - c(0:9) * 900, rnorm(10)) %>%
  x_axis(tickformatter = tickformatter_date(hourmin = "%r %Z"))

[Package rbokeh version 0.6.3 Index]