-
Notifications
You must be signed in to change notification settings - Fork 14
Typeset Figures
cpfaff edited this page May 20, 2013
·
1 revision
\begin{figure}[H] % {{{
% Label fig:test_plot
\centering
\begin{tikzpicture}
\node[pictureframe]{%
\begin{minipage}{0.45\textwidth}%
\begin{center}
<<test_plot, cache=T, fig.width=3, fig.height=2.5, out.width='\\textwidth', echo=FALSE>>=
suppressPackageStartupMessages(library(ggplot2))
ggplot(cars, aes(x=dist, y=speed)) +
geom_point(shape=1) + geom_smooth(method = "lm", size = 1) +
theme_bw() +
opts(panel.grid.major=theme_blank(), panel.grid.minor=theme_blank())
@
\end{center}
\end{minipage}
};
\end{tikzpicture}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec,
pellentesque eu, pretium quis, sem.}
\label{fig:test_plot}
\end{figure} % }}}
\begin{figure*} % {{{
% Label fig:test_plot_two
\centering
\begin{tikzpicture}
\node[pictureframe]{%
\begin{minipage}{0.97\textwidth}%
\begin{center}
<<test_plot_two, cache=T, fig.width=3, fig.height=2.5, out.width='0.45\\textwidth', echo=FALSE>>=
suppressPackageStartupMessages(library(ggplot2))
#plotting
par(mar=c(4,4,.1,.1),cex.lab=.95,cex.axis=.9,mgp=c(2,.7,0),tcl=-.3)
ggplot(movies, aes(x=rating)) +
geom_density() +
theme_bw() +
theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank())
ggplot(mtcars, aes(factor(cyl), mpg)) +
geom_boxplot() +
theme_bw() +
theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank())
@
\end{center}
\end{minipage}
};
\end{tikzpicture}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec,
pellentesque eu, pretium quis, sem.}
\label{fig:test_plot_two}
\end{figure*} % }}}
The Open-Science-Paper offers a command for simple distribution map inclusion. You can use it as follows.
\ospDistributionMap[%
mappath=osp/graphics/MapPelargoniumSidoides.pdf,%
label=fig:KaplandPelargonie]{%
Distribution of Pelargonium sidoides. Die maps was created from data
available via Global Biodiversity Information Facility database. The
distribution is restricted to regions in Lesotho and South Africa.
(Rot).}
This is a framed one column distribution map without an additional panel for the species name and picture.
\ospDistributionMap*[%
mappath=osp/graphics/MapPelargoniumSidoides.pdf,%
picpath=osp/graphics/Pelargoniumsidoides.png,%
species=Pelargonium sidoides,%
label=fig:KaplandPelargonie]{%
Distribution of Pelargonium sidoides. Die maps was created from data
available via Global Biodiversity Information Facility database. The
distribution is restricted to regions in Lesotho and South Africa.
(Rot).}
This is the starred version of the command with gives you a two column version of the distribution map. Here an additional panel is used to display the species name and a picture because species name and a picture are given.
- If you spot a typo, feel free to edit the wiki directly
- If you don't understand something, please email ctpfaff
- If you have have a longer contribution, please contact me first
Installation
Structure and Files
Typesetting
- The title header
- The footer
- Sectioning
- Lists
- Citations
- Figures
- Tables
- Math
- Code chunks
- Code listings
Workflow



