I'm trying to create a rectangle with a color gradient. While using the
following code the rectangle gets a (blue) colored line at the left
side:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\shade[left color=white, right color=blue]
(0,0) rectangle +(9cm,2cm);
\shade[left color=white, right color=blue!20]
(0,3cm) rectangle +(9cm,2cm);
\end{tikzpicture}
\end{document}
What is even more strange is that the line on the left changes as soon
as the color is modified to "blue!20" (the line gets wider).
I wouldn't expect a blue line at the left nor is it desired in my case.
Is it possible to create a rectangle with a color gradient without a
border at some side? At the moment I use a hack and create a white
rectangle in front of the left border. Something like this:
\draw[color=white, fill=white] (0,0) rectangle +(1mm,2cm);
But this is not really flexible and more like a hack. Even in the manual
of TikZ the issue arises, see manual version 2.0 on page 28. The
rectangle shading from yellow to black has at the top side a black line
which stands out because the yellow part starts there, too.
Is there some convenient/elegant solution outside?
Cheers,
Stefan
> But this is not really flexible and more like a hack. Even in the manual
> of TikZ the issue arises, see manual version 2.0 on page 28. The
> rectangle shading from yellow to black has at the top side a black line
> which stands out because the yellow part starts there, too.
>
> Is there some convenient/elegant solution outside?
Don't use evince as pdf viewer...
--
Paul Gaborit - <http://perso.mines-albi.fr/~gaborit/>
I expected a lot of things but that my PDF viewer is the root of evil I
didn't ;-)
After a quick test, Xpdf displays both PDF files correctly. Thanks for
your hint!
Regards,
Stefan