-
Notifications
You must be signed in to change notification settings - Fork 633
/
Copy pathrangeslider.Rd
54 lines (43 loc) · 1.32 KB
/
rangeslider.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/layout.R
\name{rangeslider}
\alias{rangeslider}
\title{Add a range slider to the x-axis}
\usage{
rangeslider(p, start = NULL, end = NULL, xaxes = "all", ...)
}
\arguments{
\item{p}{plotly object.}
\item{start}{a starting value for the rangeslider's range.}
\item{end}{an ending value for the rangeslider's range.}
\item{xaxes}{xaxis ids to generate rangesliders.
The default adds a rangeslider to every xaxis in the plot object.}
\item{...}{these arguments are documented here
\url{https://plot.ly/r/reference/#layout-xaxis-rangeslider}}
}
\description{
Add a range slider to the x-axis
}
\examples{
p1 <- plot_ly(x = time(USAccDeaths), y = USAccDeaths) \%>\%
add_lines() \%>\%
rangeslider()
d <- tibble::tibble(
time = seq(as.Date("2016-01-01"), as.Date("2016-08-31"), by = "days"),
y = rnorm(seq_along(time))
)
p2 <- plot_ly(d, x = ~time, y = ~y) \%>\%
add_lines() \%>\%
rangeslider(d$time[5], d$time[50])
subplot(p1, p2, nrows = 2, margin = 0.1)
# calling rangeslider on a plot with multiple axes
# generates multiple rangesliders
subplot(qplot(1:10), qplot(1:10, 1:10)) \%>\%
rangeslider()
# add a rangeslider to just the 2nd xaxis
subplot(qplot(1:10), qplot(1:10, 1:10)) \%>\%
rangeslider(xaxes = "xaxis2")
}
\author{
Carson Sievert
}