4
4
\title {Save a ggplot with sensible defaults }
5
5
\usage {
6
6
ggsave(filename = default_name(plot ), plot = last_plot(),
7
- device = default_device(filename ), path = NULL , scale = 1 ,
7
+ device = default_device(ext ), path = NULL , scale = 1 ,
8
8
width = par(" din" )[1 ], height = par(" din" )[2 ], units = c(" in" , " cm" ,
9
- " mm" ), dpi = 300 , limitsize = TRUE , ... )
9
+ " mm" ), dpi = 300 , limitsize = TRUE , ext = default_ext( filename ), ... )
10
10
}
11
11
\arguments {
12
12
\item {filename }{file name / filename of plot }
13
13
14
14
\item {plot }{plot to save , defaults to last plot displayed }
15
15
16
- \item {device }{device to use , automatically extract from file name extension }
16
+ \item {device }{device to use , automatically extract from
17
+ file name extension (or from paramter \code {ext } if
18
+ specified )}
17
19
18
20
\item {path }{path to save plot to (if you just want to set path and not
19
21
filename )}
@@ -32,7 +34,13 @@ filename)}
32
34
save images larger than 50x50 inches , to prevent the common error of
33
35
specifying dimensions in pixels. }
34
36
35
- \item {... }{other arguments passed to graphics device }
37
+ \item {ext }{file extension to use for choosing the correct
38
+ device (pdf , jpg , png , etc. ), uses extension of the
39
+ filename by default , specify if filename does not have an
40
+ instructive extension (or none at all , e.g. in a
41
+ temporary file )}
42
+
43
+ \item {... }{other arguments passed to graphics device }
36
44
}
37
45
\description {
38
46
ggsave is a convenient function for saving a plot. It defaults to
0 commit comments