[Tikzdevice-bugs] tikz and grid/lines/axis?

Cameron Bracken cameron.bracken at gmail.com
Thu Apr 14 18:21:57 CEST 2011


Hi Matthieu-

So it looks like this is a bug. Everything is actually there except
the green background. I think we were assuming the graphics system
would tell us to "draw a green rectangle" for the change in background
color but it actually needs to be done by us manually for the "bg"
parameter.

A temporary fix is to manually modify the background rectangle in the
tikz code (this it a pain, I know) to

\draw[color=green, fill=green] (0,0) rectangle (505.89,505.89);

When that is changed, the graphic looks like it should. Sorry for this
inconvenience.

-Cameron



On Thu, Apr 14, 2011 at 4: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