save_figtex: Create a plot, and create a tex figure string

Description Usage Arguments Value

View source: R/figtex.R

Description

This function takes a plot object and prints it out as a file onto the disk, either as a png or a pdf. The dimensions of the figure can be specified manually or using some convinient options. The location of the saved figure can be specifed. Optionally, this function will generate a latex-file of the generated plot that can be input into a master tex document. This will include a caption that is specied as an argument.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
save_figtex(
  plot,
  title,
  caption,
  size = "third",
  figure.dir = "results/figures",
  latex.dir = "results/tex",
  margins = 0.75,
  type = c("pdf", "png", "both"),
  res = 300,
  latex = TRUE
)

Arguments

plot

The plot to save

title

The title of the plot, which will serve as a base file name, and the latex label.

caption

A description of the figure. This will be input into the latex file.

size

The dimensions of the generated file. Takes either a string, or a vector of lencth 2, as c('height', 'width'). String optsion are:

full

Full page

half

Half of the page, folded height-wise

quarter

One quarter of the page, folded height and width-wise

third

One third of the page, folded height-wise

sixth

One sixth of the page, folded in half width-wise, and in a third height-wise

figure.dir

Which directory to save the file.

latex.dir

Which directory to save the latex include file.

margins

The margins of the main file to which the figure is intended to be saved.

type

What to save the raw image as, either as a pdf or a png.

latex

Create a latex include file.

Value

Print out file names and save the include string to the cliopboard.


ejurga/ejuRga.Tools documentation built on March 19, 2021, 9:55 p.m.