element_latex | R Documentation |
This theme element is an alternative to ggplot2::element_text()
for producing labels from LaTeX fragments.
Both hjust
and vjust
can be character values:
one of "left"
, "bbleft"
, "centre"
,
"center"
, "right"
, "bbright"
for horizontal
justification; and one of "bottom"
, "baseline"
,
"centre"
, "center"
, or "top"
for
vertical justification.
element_latex(family=NULL,
fontface=NULL,
colour=NULL,
size=NULL,
hjust=NULL, vjust=NULL,
angle=NULL,
lineheight=NULL,
color=NULL,
margin=NULL,
width=NULL,
packages=NULL,
engine=getOption("xdvir.engine"),
rotate_margins=FALSE,
inherit.blank=FALSE)
family |
The default font family. |
fontface |
The default font face. |
colour , color |
The default text colour. |
size |
The deafult font size. |
hjust |
Horizontal justification. Typically in |
vjust |
Vertical justification. Typically in |
angle |
Angle (in |
lineheight |
The deafult lineheight. |
margin |
The margin around the text. |
width |
Either |
packages |
The LaTeX packages to be used.
May be the name of a LaTeX package (character) or a
|
engine |
The TeX engine that should be used to render the LaTeX.
May be the name of a TeX engine (character)
or a |
rotate_margins |
Whether margins should follow the orientation of the text. |
inherit.blank |
Should this element inherit the existence of an
|
An element_latex
object that can be used in place of
element_text
in ggplot2 theme specifications
## Not run:
# Requires TeX installation and 'ggplot2'
require(ggplot2)
ggplot(mtcars) +
geom_point(aes(disp, mpg)) +
ggtitle("\textit{The} \texttt{mtcars} data set") +
theme(plot.title=element_latex())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.