pgfSweave now on CRAN

At long last pgfSweave has finally made its way to CRAN.

http://cran.r-project.org/web/packages/pgfSweave/index.html

The pgfSweave R package is about speed and style of graphics. For speed, the package provides capabilities for “caching” graphics generated with Sweave on top of the caching funcitonality of cacheSweave. For style the pgfSweave package facilitates the integration of R graphics with LaTeX reports through the tikzDevice package and eps2pgf utility. With these tools, figure labels are converted to LaTeX strings so they match the style of the document and the full range of LaTeX math symbols/equations are available.

The backbone of pgfSweave is a a new driver for Sweave (pgfSweaveDriver). The driver provides new chunk options tikz, pgf and external on top of the cache option provided by cacheSweave.

This package started as a fork (hack) of cacheSweave to suit our own narrow purposes and has since become a valuable tool for much of our own work. We hope you will find it useful as well.

-Cameron Bracken and Charlie Sharpsteen

6 thoughts on “pgfSweave now on CRAN

  1. Hi Cameron,

    Is there a way to control the font size with a pgf image is scale?

    I’m using the images inside of a minipage setup which scales the images and I’m looking for a way to have the text remain at a constant size while the R graphic is scale.

    I’ve been banging my ahead against the wall (well more specifically Google) trying to find an answer but I’ve come up with nothing so far.

    Many thanks,

    Jay

    P.S. I am fairly new to LaTeX and sweave, pgfsweave and tikzDevice.

    \begin{figure}[h]
    \centering
    \subfloat[Style]{
        \begin{minipage
    }[h]{0.7\linewidth}
            \centering\beginpgfgraphicnamed{style_box}
            \input{style_box.tex}
            \endpgfgraphicnamed
            %\centering\includegraphics[width=1\linewidth]{style_box.pdf}
            \label{fig:effectstyle}
        \end{minipage}}
    \hspace{5pt}
    \subfloat[Equity Rank]{
        \begin{minipage
    }[h]{0.5\linewidth}
            \centering\beginpgfgraphicnamed{rank_box}
            \input{rank_box.tex}
            \endpgfgraphicnamed
            %\centering\includegraphics[width=1\linewidth]{rank_box.pdf}
            \label{fig:effectrank}
        \end{minipage}}
    \subfloat[Grouped Equity Rank]{
        \begin{minipage
    }[h]{0.5\linewidth}
            \centering\beginpgfgraphicnamed{cut_box}
            \input{cut_box.tex}
            \endpgfgraphicnamed
            %\centering\includegraphics[width=1\linewidth]{cut_box.pdf}
            \label{fig:effectgrouped}
        \end{minipage}}
    \caption{Net Sales Effects}
    \end{figure}

  2. I don’t know how to to fix your specific problem. What end effect are you trying to achieve? Three subfigures, one above and two below? It seems that way from what I can tell. If that is the case then you may try the subfigure environment and not a bunch of minipages.

  3. Thanks for your comments.

    That’s probably my infancy with LaTeX. I was using minipage in order to set the vertical space between the rows of images and subfig to set captions, etc…

    Is there a way to do the whole job with subfig?

    Is there a way to directly specify font size in pgf/tikz?

  4. As per my previous comment, I would actually not use minipages like this

    % requires \\usepackage{subfigure}
    \begin{figure}[h]
    \centering
    \subfigure[Graph 1\label{fig:graph1}]{
        \centering\beginpgfgraphicnamed{graph1
    }
        \input{graph1.tex}
        \endpgfgraphicnamed}
    \hspace{5pt}
    \subfigure[Graph 2 \label{fig:graph2}]{
        \centering\beginpgfgraphicnamed{graph2
    }
        \input{graph2.tex}
        \endpgfgraphicnamed}
    \subfigure[Graph 3\label{fig:graph3}]{
        \centering\beginpgfgraphicnamed{graph3
    }
        \input{graph3.tex}
        \endpgfgraphicnamed}
    \caption{Three Graphs}
    \end{figure}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>