/
export_graph.Rd
76 lines (69 loc) · 1.78 KB
/
export_graph.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/export_graph.R
\name{export_graph}
\alias{export_graph}
\title{Export a graph to various image formats}
\usage{
export_graph(
graph,
file_name = NULL,
file_type = NULL,
title = NULL,
width = NULL,
height = NULL
)
}
\arguments{
\item{graph}{A graph object of class \code{dgr_graph}.}
\item{file_name}{The name of the exported file (including it's extension).}
\item{file_type}{The type of file to be exported. Options for graph files
are: \code{png}, \code{pdf}, \code{svg}, and \code{ps}.}
\item{title}{An optional title for the output graph.}
\item{width}{Output width in pixels or \code{NULL} for default. Only useful for
export to image file formats \code{png}, \code{pdf}, \code{svg}, and \code{ps}.}
\item{height}{Output height in pixels or \code{NULL} for default. Only useful for
export to image file formats \code{png}, \code{pdf}, \code{svg}, and \code{ps}.}
}
\description{
Export a graph to a variety of image formats such as PNG, PDF, SVG, and
PostScript.
}
\examples{
# Create a simple graph
graph <-
create_graph() \%>\%
add_path(
n = 5,
edge_aes = edge_aes(
arrowhead = c(
"normal", "vee",
"tee", "dot"
),
color = c(
"red", "blue",
"orange", "purple"
)
)
)
# Create a PDF file for
# the graph (`graph.pdf`)
# graph \%>\%
# export_graph(
# file_name = "graph.pdf",
# title = "Simple Graph"
# )
# Create a PNG file for
# the graph (`mypng.png`)
# graph \%>\%
# export_graph(
# file_name = "mypng.png",
# file_type = "PNG"
# )
}
\seealso{
Other Display and Save:
\code{\link{render_graph_from_graph_series}()},
\code{\link{render_graph}()},
\code{\link{save_graph}()}
}
\concept{Display and Save}