-
Notifications
You must be signed in to change notification settings - Fork 633
/
Copy pathplot_ly.Rd
85 lines (70 loc) · 3.03 KB
/
plot_ly.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/plotly.R
\name{plot_ly}
\alias{plot_ly}
\title{Initiate a plotly visualization}
\usage{
plot_ly(data = data.frame(), ..., type = "scatter", group, color, colors,
symbol, symbols, size, filename, fileopt, world_readable = TRUE,
inherit = TRUE, evaluate = FALSE)
}
\arguments{
\item{data}{A data frame (optional).}
\item{...}{These arguments are documented in the references section below.
Note that acceptable arguments depend on the trace type.}
\item{type}{A charater string describing the type of trace.}
\item{group}{Either a variable name or a vector to use for grouping. If used,
a different trace will be created for each unique value.}
\item{color}{Either a variable name or a vector to use for color mapping.}
\item{colors}{Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"),
or a vector of colors to interpolate in hexadecimal "#RRGGBB" format,
or a color interpolation function like \code{colorRamp()}.}
\item{symbol}{Either a variable name or a (discrete) vector to use for symbol encoding.}
\item{symbols}{A character vector of symbol types. Possible values:
'dot', 'cross', 'diamond', 'square', 'triangle-down', 'triangle-left', 'triangle-right', 'triangle-up'}
\item{size}{A variable name or numeric vector to encode the size of markers.}
\item{filename}{character string describing the name of the plot in your plotly account.
Use / to specify directories. If a directory path does not exist it will be created.
If this argument is not specified and the title of the plot exists,
that will be used for the filename.}
\item{fileopt}{character string describing whether to create a "new" plotly, "overwrite" an existing plotly,
"append" data to existing plotly, or "extend" it.}
\item{world_readable}{logical. If \code{TRUE}, the graph is viewable
by anyone who has the link and in the owner's plotly account.
If \code{FALSE}, graph is only viewable in the owner's plotly account.}
\item{inherit}{logical. Should future traces inherit properties from this initial trace?}
\item{evaluate}{logical. Evaluate arguments when this function is called?}
}
\description{
Transform data into a plotly visualization.
}
\details{
There are a number of "visual properties" that aren't included in the officical
Reference section (see below).
}
\examples{
\dontrun{
data(economics, package = "ggplot2")
# basic time-series plot
p <- plot_ly(economics, x = date, y = uempmed, type = "scatter",
showlegend = FALSE)
# add a loess smoother
p2 <- add_trace(p, y = fitted(loess(uempmed ~ as.numeric(date))))
# add a title
p3 <- layout(p2, title = "Median duration of unemployment (in weeks)")
# change the font
layout(p3, font = list(family = "Courier New, monospace"))
# sometimes, a data frame isn't fit for the use case...
# for 3D surface plots, a numeric matrix is more natural
plot_ly(z = volcano, type = "surface")
}
}
\author{
Carson Sievert
}
\references{
\url{https://plot.ly/r/reference/}
}
\seealso{
\code{\link{layout}()}, \code{\link{add_trace}()}, \code{\link{style}()}
}