You could use the pgf-blur
package, which gives you this:
In fact, it can add a "faded" drop shadow to pretty much anything:
The shadow fading is not continuous, like in the previously accepted answer. It fades in a number of discrete steps, but that number can be changed, see the documentation.
Here's the code for the examples:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\begin{document}
\begin{center}
\begin{tikzpicture}
\node[draw=none,shade,
top color=blue!40,
bottom color=blue!5,
rounded corners=6pt,
blur shadow={shadow blur steps=5}
] {\sffamily\bfseries\large A pretty box};
\node[tape,draw=none,shade,
top color=blue!40,
bottom color=blue!5,
rounded corners=1pt,
blur shadow={shadow blur steps=5,shadow blur extra rounding=1.3pt}
] at (5,0){\sffamily\bfseries\large Another pretty box};
\end{tikzpicture}
\end{center}
\end{document}
Edit
Sometimes, PDF renderers will show a dark line in the center of the shadow. This is due to the way they handle anti-aliasing and clipping. To avoid this:
- Use pgf-blur v1.01, which tries hard to hide this artefact
- In Acrobat, turn off the "Page Display" preference "Enhance thin lines". These shadows consist of many thin lines, and they won't look good if Acrobat changes their width
- Don't use too many
blur shadow steps
. It looks best if you have about two pixels per step at viewing resolution.
Not very sophisticated … (but then: Why so tight ticks? Why not pgfplots
?)
Code (the scope
)
\begin{scope}[ticklabel/.style={fill=white,path fading=fade out,text opacity=1.0}]
\foreach \x in {-4,-3,-2,-1,1,2,3,4}{
\node[below,ticklabel] at (\x,0) {$\phantom{\x}$};
\node[left,ticklabel] at (0,\x) {$\phantom{\x}$};
}
\foreach \x in {-4,-3,-2,-1,1,2,3,4}{
\node[below] at (\x,0) {$\x$};
\node[left] at (0,\x) {$\x$};
}
\end{scope}
Output
Best Answer
By default, there's no option for setting the transition speed between the colors of a linear shading. You can relatively easily add it, though. Here's a new style
fading speed=<0..100>
that allow setting the transition speed for the standardaxis
shading.