[R] getting "small" graphs with Sweave using Rnews.sty

Dieter Menne dieter.menne at menne-biomed.de
Tue Nov 4 09:52:24 CET 2008



Jeff D. Hamann wrote:
> 
> I've started playing with the example r news project and wanted to start 
> adding some graphs, but replacing:
> 
> ...
> Is it possible, to get a "small" graphic this way, or should I write
> out a temp graph as a pdf and include the graphic by constructing the
> statement using Sweave?
> 

It is difficult to understand what you mean because your example is not
complete. Trying to make a self-running example see below: could you
explain?

Dieter


\documentclass[a4paper]{report}
\usepackage{Rnews}
\usepackage{Sweave}
\SweaveOpts{strip.white=all, keep.source=TRUE}

\begin{document}
\begin{article}

\title{My Example}
\maketitle

\begin{figure}
\vspace*{.1in}
\framebox[\textwidth]{\hfill \raisebox{-.45in}{\rule{0in}{1in}}
                       A graph goes here \hfill}
\caption{\label{figure:onecolfig}
A normal figure only occupies one column.}
\end{figure}

yields a an empty box, which is good, with the following:

\begin{figure}
\vspace*{.1in}
<<fig=true,echo=false>>=
plot( rnorm( 100 ) )
@
\caption{A normal figure only occupies one column.}
\label{figure:onecolfig}
\end{figure}

\end{article}
\end{document}

-- 
View this message in context: http://www.nabble.com/getting-%22small%22-graphs-with-Sweave-using-Rnews.sty-tp20315395p20318339.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list