Sharpie / RTikZDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
31 stars 36 forks source link

Empty tikzpicture created incorrectly #12

Closed cameronbracken closed 12 years ago

cameronbracken commented 14 years ago
source('http://addictedtor.free.fr/graphiques/sources/source_122.R')

The function diagwl from the climatol package calls plot.new() which creates a new tikzpicture; then it calls par() which closes the tikzpicture without creating any content but throws in a \end{scope}, causing compilation to fail.

This is the offending chunk:

\begin{tikzpicture}[x=1pt,y=1pt]
\draw[color=white,opacity=0] (0,0) rectangle (505.89,505.89);
\end{scope}
\end{tikzpicture}

A tikzpicture should NOT be created when there is not content to put in. pdf() does not create a blank page here so we should not.

cameronbracken commented 14 years ago

Here is a minimal example to reproduce the bug:

tikz(standAlone=T)
plot.new()
plot(1)
dev.off()
system('pdflatex Rplots.tex')