figure: generate (and save) graphic devices with flexible fileformat...

Description Usage Arguments Author(s) See Also Examples

View source: R/figure.r

Description

figure generates graphic devices with flexible fileformat selection. Function call with (figure(do.save=T) needs to be finished by close_fig(do.save=T), to close open file connection.

Usage

1
2
figure(filename, folder, type, save=F, do.save=save, 
       width=10, height=10, xpos=-1, do.overwrite=T, delete.old=do.overwrite, ...)

Arguments

filename

name of the figure to be generated (without file extension)

folder

plot folder (by default current working directory)

type

character string indicating the graphics format of the figure file. can be:

  • "jpg"

  • "jpeg"

  • "png"

  • "eps"

  • "pdf"

width, height

width and height of figure to be generated. default units are inches.

save, do.save

whether file should be saved or not (default is TRUE). if FALSE, new graphic device will be opened inside R.

xpos

horizontal screen position of graphic device (ignored if do.save == TRUE)

do.overwrite, delete.old

overwrite existing figure with same filename and extension (default is FALSE)

...

additional arguments to be passed to the graphic device

Author(s)

Robert K. Bauer

See Also

close_fig

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Example 1: plotmap() and figure()
do.save <- FALSE
figure("Gulf_of_Lions_extended", do.save=do.save, width=5, height=5, type="pdf")
plotmap("lion")
close_fig(do.save)

## now resize figure manually and get new figure dimensions:
width <- dev.size()[1]
height <- dev.size()[2]

do.save <- TRUE
figure("Gulf_of_Lions_extended", do.save=do.save, width=width, height=height, type="pdf")
plotmap("lion")
close_fig(do.save)

oceanmap documentation built on June 21, 2017, 5:01 p.m.

Search within the oceanmap package
Search all R packages, documentation and source code