File: save_plot.Rd

package info (click to toggle)
r-cran-sjplot 2.8.17%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,596 kB
  • sloc: sh: 13; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,920 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/save_plot.R
\name{save_plot}
\alias{save_plot}
\title{Save ggplot-figure for print publication}
\usage{
save_plot(
  filename,
  fig = last_plot(),
  width = 12,
  height = 9,
  dpi = 300,
  theme = theme_get(),
  label.color = "black",
  label.size = 2.4,
  axis.textsize = 0.8,
  axis.titlesize = 0.75,
  legend.textsize = 0.6,
  legend.titlesize = 0.65,
  legend.itemsize = 0.5
)
}
\arguments{
\item{filename}{Name of the output file; filename must end with one
of the following accepted file types: ".png", ".jpg", ".svg" or ".tif".}

\item{fig}{The plot that should be saved. By default, the last plot is saved.}

\item{width}{Width of the figure, in centimetres.}

\item{height}{Height of the figure, in centimetres.}

\item{dpi}{Resolution in dpi (dots per inch). Ignored for vector formats, such as ".svg".}

\item{theme}{The default theme to use when saving the plot.}

\item{label.color}{Color value for labels (axis, plot, etc.).}

\item{label.size}{Fontsize of value labels inside plot area.}

\item{axis.textsize}{Fontsize of axis labels.}

\item{axis.titlesize}{Fontsize of axis titles.}

\item{legend.textsize}{Fontsize of legend labels.}

\item{legend.titlesize}{Fontsize of legend title.}

\item{legend.itemsize}{Size of legend's item (legend key), in centimetres.}
}
\description{
Convenient function to save the last ggplot-figure in
               high quality for publication.
}
\note{
This is a convenient function with some default settings that should
        come close to most of the needs for fontsize and scaling in figures
        when saving them for printing or publishing. It uses cairographics
        anti-aliasing (see \code{\link[grDevices]{png}}).
        \cr \cr
        For adjusting plot appearance, see also \code{\link{sjPlot-themes}}.
}