Description Usage Arguments Details Author(s) Examples
Generates the code to place a figure in a Latex document
1 2 3 4 |
filename |
Character string giving the location of the file to be included |
caption |
Text giving the caption for the figure |
align |
Character string stating the alignment. Valid options are
|
height |
The height of the figure |
width |
The width of the figure |
units |
The units for height and width. Defaults to |
counter |
Name of a counter to use to number the table |
counterSet |
The number to which |
label |
Name of a label |
placement |
Controls the placement of the figure. Options are
|
alt |
For HTML documents only–when |
cat |
Logical. Determines if the output is returned as a character string
or returned via the |
For LaTeX files, placement
options are used as follows:
ht | Place the float here, i.e., approximately at the same point it occurs |
t | Position at the top of the page |
b | Position at the bottom of the page |
p | Put on a special page for floats only |
H | Places the float at precisely the location in the LaTeX code. Requires the float package |
The "!"
may be used after any of these in order to override
LaTeX float rules and force your selection. More can be learned by
reading about floats in a LaTeX manual.
For HTML files, the file can be any type supported by the browser. JPEGs and PNGs seem to work well.
Benjamin Nutter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
pdf("MPG.pdf", height=4, width=4)
hist(mtcars$mpg)
dev.off()
lazy.figure("MPG.pdf")
lazy.write(
lazy.file.start(),
lazy.figure("MPG.pdf",
caption="Distribution of Miles per Gallon in mtcars dataset",
height=5, width=5, label="MPGgraph"),
lazy.file.end(),
OutFile="Example-1.tex")
unlink("MPG.pdf")
unlink("Example-1.tex")
unlink("Example-1.pdf")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.