Plot representations

Description

repr_text.recordedplot only returns a small info string containing the title (if any) while the others return a character vector (SVG) a raw vector (the rest) containing the image data.

Usage

 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
## S3 method for class 'recordedplot'
repr_text(obj, ...)

## S3 method for class 'recordedplot'
repr_png(obj, width = getOption("repr.plot.width"),
  height = getOption("repr.plot.height"), bg = getOption("repr.plot.bg"),
  pointsize = getOption("repr.plot.pointsize"),
  antialias = getOption("repr.plot.antialias"),
  res = getOption("repr.plot.res"), ...)

## S3 method for class 'recordedplot'
repr_jpg(obj, width = getOption("repr.plot.width"),
  height = getOption("repr.plot.height"), bg = getOption("repr.plot.bg"),
  pointsize = getOption("repr.plot.pointsize"),
  antialias = getOption("repr.plot.antialias"),
  res = getOption("repr.plot.res"),
  quality = getOption("repr.plot.quality"), ...)

## S3 method for class 'recordedplot'
repr_svg(obj, width = getOption("repr.plot.width"),
  height = getOption("repr.plot.height"), bg = getOption("repr.plot.bg"),
  pointsize = getOption("repr.plot.pointsize"),
  antialias = getOption("repr.plot.antialias"),
  family = getOption("repr.plot.family"), ...)

## S3 method for class 'recordedplot'
repr_pdf(obj, width = getOption("repr.plot.width"),
  height = getOption("repr.plot.height"), bg = getOption("repr.plot.bg"),
  pointsize = getOption("repr.plot.pointsize"),
  antialias = getOption("repr.plot.antialias"),
  family = getOption("repr.plot.family"), ...)

Arguments

obj

The plot to create a representation for

...

ignored

width

Plot area width in inches (default: 7)

height

Plot area height in inches (default: 7)

bg

Background color (default: white)

pointsize

Text height in pt (default: 12)

antialias

Which kind of antialiasing to use for for lines and text? 'gray', 'subpixel' or 'none'? (default: gray)

res

For PNG and JPEG, specifies the PPI for rasterization (default: 120)

quality

For JPEG, determines the compression quality in % (default: 90)

family

Font family for SVG and PDF. 'sans', 'serif', 'mono' or a specific one (default: sans)

Details

All parameters can also be specified using the eponymous repr.plot.* repr-options.

Examples

1
2
3
4
5
6
7
dev.new()
dev.control(displaylist = 'enable')
plot(sqrt, main = 'Square root')
p <- recordPlot()
dev.off()

repr_text(p)