I am discovering an interesting issue when using tikz for ggplot2, in a
LaTeX document where package transparent is loaded...
Basically, when the user does not specify explicitely which color should
be used in ggplots bars (the color for outer lines of bars, not for
inner fill), ggplot will not put any. tikz seems to be doing the same.
However, things change when the package transparency is loaded: outer
lines are now visible!
Please compare reproducible example below, adding/removing %
\usepackage{transparent}:
library(ggplot2)
library(tikzDevice)
options( tikzLatexPackages = c(
"\\usepackage{tikz}",
"\\usepackage{transparent}",
"\\usepackage[active,tightpage]{preview}",
"\\PreviewEnvironment{pgfpicture}",
"\\setlength\\PreviewBorder{0pt}")
)
tikz(standAlone=TRUE)
diamonds2<-droplevels(subset(diamonds, color%in%c("E","I")))
qplot(carat, data = diamonds2, geom = "bar", fill =
color)#+myScale_fill3()+scale_colour_manual(value =
rep(c(part1_sec1,part1_sec2),3))
dev.off()
Do you confirm outer lines change with/without pkg transparent or is it
specific to my computer? Were you aware of this? How can one solve it?
Thanks!!
Matthieu
_______________________________________________
Tikzdevice-bugs mailing list
Tikzdev...@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tikzdevice-bugs
MS> Basically, when the user does not specify explicitely which color should
MS> be used in ggplots bars (the color for outer lines of bars, not for
MS> inner fill), ggplot will not put any. tikz seems to be doing the same.
MS> However, things change when the package transparency is loaded: outer
MS> lines are now visible!
Well, tikz uses its own transparency code (see examples in
http://www.texample.net/tikz/examples/feature/transparency/), and it
seems to conflict with the one in transparent package.
The documentation of transparent package says `Because of the poor
interface for page resources, there can be problems with
packages that also use \pdfpageresources.'. Pgf is one of such
packages: systemlayer/pgfsys-pdftex.def says:
\expandafter\global\expandafter\pdfpageresources\expandafter{\temp}
I'd suggest using tikz transparency code for tikz pictures...
--
Good luck
-Boris
You never learn anything by doing it right.
-Charlie
Well the issue is when on e is using a R -> tikz picture in a latex
class that is using transparent by default! The package transparent is
loaded for other purpose than the tikz code, but yet interacts with
it.... I guess there is no way to prevent this other than removing the
transparent package?
Thanks!!
Mat