[Tikzdevice-bugs] tikz and grid/lines/axis?
Charlie Sharpsteen
chuck at sharpsteen.net
Thu Apr 14 18:42:37 CEST 2011
Hi Matthieu,
It appears you have found a bug. What happens is that the call to
tikz() opens a new .tex file and draws an invisible rectangle that is
the size of the plotting canvas. As Cameron mentioned, it looks like
we figured R graphics functions would come along and fill in a
background if they wanted some color. We never noticed this wasn't
happening because we mostly use our plots in reports that are printed
out on white paper.
I tried to find a workaround at the R level---but no luck so far as
this stuff all happens at the C level. For right now Cameron's
suggestion is the only way I can think of to change the background
color. I will work on a fix for this issue and we will release a
0.6.1 to CRAN as soon as it is done as this is pretty major.
Thanks for taking the time to try our package and the extra time to
report this bug!
-Charlie
On Thu, Apr 14, 2011 at 3:14 AM, Matthieu Stigler
<matthieu.stigler at gmail.com> wrote:
> Hi
>
> I'm trying to use tikzDevice for a quite complex plot, which has a grid,
> adds axis, background color, and so on... However, the pdf I get looses much
> of the information... Did I do something wrong? Did I miss some important
> parameters/options?
>
> Thanks!
>
> Matthieu Stigler
>
> ## The plot:
> op<-par(bg=11,bty="n", cex=2, mar=c(3,4,1,2)+0.1)
> x <- runif(100)
> plot(x, las=1, yaxt="n",tcl=0, ann=F, type="l", lwd=2, col="blue")
> grid(col="white", lty="solid", nx=NA, ny=NULL, lwd=2)
> lines(x, col="blue", lwd=2)
> axis(1, tcl=0, labels=FALSE, col="black", lwd=1,
> at=as.Date(c("1970-01-01","2011-01-01")))
> axis(2, las=2, tick=FALSE)
> par(op)
>
>
> ### with tikz:
> library(tikzDevice)
>
> tikz("try.tex", standAlone=TRUE)
> op<-par(bg=11,bty="n", cex=2, mar=c(3,4,1,2)+0.1)
> x <- runif(100)
> plot(x, las=1, yaxt="n",tcl=0, ann=F, type="l", lwd=2, col="blue")
> grid(col="white", lty="solid", nx=NA, ny=NULL, lwd=2)
> lines(x, col="blue", lwd=2)
> axis(1, tcl=0, labels=FALSE, col="black", lwd=1,
> at=as.Date(c("1970-01-01","2011-01-01")))
> axis(2, las=2, tick=FALSE)
> par(op)
> dev.off()
>
> _______________________________________________
> Tikzdevice-bugs mailing list
> Tikzdevice-bugs at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tikzdevice-bugs
>
More information about the Tikzdevice-bugs
mailing list