Sharpie / RTikZDevice

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

Incorrect draw color for background rectangle #41

Closed cameronbracken closed 13 years ago

cameronbracken commented 13 years ago

I dont believe there is a way to specify the background border color but tikzDevice uses it nontheless when drawing the background rectangle. The result is not visible on a white background but is when using different colors. See the original report:

I am trying to get a plot with the same background color than the background color of the LaTeX page. However, it seems that tikzDevice is introducing by default a command:

\definecolor[named]{fillColor}{rgb}{1.00,1.00,1.00}
\fill[color=fillColor,] (0,0) rectangle (238.49,238.49);

I searched around to see how to remove this line... did not find... is there any way to remove it?

I am using R 2.13 and tikzDevice 0.6.1 (see below for full sesionInfo).

Here would be full reproducible code:

library(ggplot2)
library(tikzDevice)

part1_main70bis<-rgb(0.05,0.4,0.5,maxColorValue=1)
theme_update(
plot.background = theme_rect(fill = part1_main70bis, colour=part1_main70bis)
)
options(tikzLatexPackages=c("\\usepackage{tikz}","\\usepackage{color}\n\\definecolor{part1}{rgb}{0.05,0.4,0.5}\n\\pagecolor{part1}\n"))
tikz(standAlone=TRUE)
qplot(1,1)
dev.off()

It is this white border I would like to remove, do you see it? The guilty line is this one (line 13): % \fillcolor=fillColor, rectangle (505.89,505.89);

Thanks! Matthieu

> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=fr_FR.UTF-8          LC_NUMERIC=C
[3] LC_TIME=fr_FR.UTF-8           LC_COLLATE=fr_FR.UTF-8
[5] LC_MONETARY=fr_FR.UTF-8       LC_MESSAGES=en_US.utf8
[7] LC_PAPER=fr_FR.UTF-8          LC_NAME=fr_FR.UTF-8
[9] LC_ADDRESS=fr_FR.UTF-8        LC_TELEPHONE=fr_FR.UTF-8
[11] LC_MEASUREMENT=fr_FR.UTF-8    LC_IDENTIFICATION=fr_FR.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
[1] ggplot2_0.8.9    proto_0.3-9.2    reshape_0.8.4    plyr_1.6
[5] tikzDevice_0.6.1 filehash_2.2     rkward_0.5.6

loaded via a namespace (and not attached):
[1] tools_2.13.1
Sharpie commented 13 years ago

Pulled into master. Thanks for fixing!