I am trying to create a density plot with TikZ using \fill
and tightly stacked rectangles. The thin unwanted borders in the image, are they an artefact of rendering or a feature of fill
? Can they be eliminated/smoothened?
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{gnuplot-lua-tikz} %for colors
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[xscale=0.05,yscale=0.3]
\fill[rgb color={0.40,0.50,0.01}, opacity=0.75] (0.000,0.00) -- (2.000,0.00) -- (2.000,0.40) -- (0.000,0.40) -- cycle;
\fill[rgb color={0.40,0.50,0.01}, opacity=0.75] (0.000,0.40) -- (2.000,0.40) -- (2.000,0.80) -- (0.000,0.80) -- cycle;
\fill[rgb color={0.40,0.50,0.01}, opacity=0.75] (0.000,0.80) -- (2.000,0.80) -- (2.000,1.20) -- (0.000,1.20) -- cycle;
\fill[rgb color={0.40,0.50,0.01}, opacity=0.75] (0.000,1.20) -- (2.000,1.20) -- (2.000,1.60) -- (0.000,1.60) -- cycle;
\fill[rgb color={0.40,0.50,0.01}, opacity=0.75] (0.000,1.60) -- (2.000,1.60) -- (2.000,2.00) -- (0.000,2.00) -- cycle;
\fill[rgb color={0.68,0.74,0.48}, opacity=0.75] (0.000,2.00) -- (2.000,2.00) -- (2.000,2.40) -- (0.000,2.40) -- cycle;
\fill[rgb color={0.95,0.96,0.92}, opacity=0.75] (0.000,2.40) -- (2.000,2.40) -- (2.000,2.80) -- (0.000,2.80) -- cycle;
\fill[rgb color={0.99,0.99,0.98}, opacity=0.75] (0.000,2.80) -- (2.000,2.80) -- (2.000,3.20) -- (0.000,3.20) -- cycle;
% ...
\end{tikzpicture}
\end{document}
gnuplot-lua-tikz
is not on CTAN, so it would be nice if you added a link. But even if I use the one that is the first hit on Google, I get an error because thergb color
key isn't defined there, or in TikZ.line width=0pt
-- just a wild guess though.rgb color
with different shades of green, and I didn't get any white lines. Try zooming in/out a bit in the PDF viewer.draw, line width=0.5pt
(or any suitable dimension), generally speaking, that assures that rectangles are slightly bigger and they are covering some extra (hopefully white) space around the border.