# How can I remove the shade in this TikZ picture to get white filling?

I want pure white fill so that upper most circle becomes incomplete. But black shade comes in the figure. Is there any easier way to do this?

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}[scale=1.0, ,transform shape]
\node [draw, thick, minimum size=1cm, circle] at (0,0) {};
\node [draw, thick, minimum size=1cm, circle] at (1,0) {};
\node [draw, thick, minimum size=1cm, circle] at (2,0) {};
\node [draw, thick, minimum size=1cm, circle] at (-1,0) {};

\node [draw, thick, minimum size=1cm, circle] at (1.5,-0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (0.5,-0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (-0.5,-0.85) {};

\node [draw, thick, minimum size=1cm, circle] at (1.5,0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (0.5,0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (-0.5,0.85) {};

\node [draw, thick, minimum size=1cm, circle] at (1.0,2*0.85) {};

\draw[dotted,thin](-1.5,-2)--(-1.5,2.0)--(2.5,2.0)--(2.5,-2)--(-1.5,-2);

\end{tikzpicture}
\end{center}
\caption{hhhhhhhhh}
\label{figspahre}
\end{figure}

\end{document}

-
as an aside, see should-i-use-center-or-centering-for-figures-and-tables –  cmhughes Oct 21 '12 at 15:50

Replace

\shade[fill=white!20!white, draw=white!40!black]-1.5,2.0)--(2.5,2.0)--(2.5,2.5)--(-1.5,2.5);


by

\draw[draw=none,fill=white!20](-1.5,2.0)--(2.5,2.0)--(2.5,2.5)--(-1.5,2.5);


If you want the rectangle above, use

\draw[draw=white!40!black,fill=white!20](-1.5,2.0)--(2.5,2.0)--(2.5,2.5)--(-1.5,2.5) -- cycle;


Other possible commands are \fill and \filldraw.

Code

\documentclass[twoside]{article}
\usepackage{graphicx}
\usepackage{tikz}

\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[scale=1.0, ,transform shape]
\node [draw, thick, minimum size=1cm, circle] at (0,0) {};
\node [draw, thick, minimum size=1cm, circle] at (1,0) {};
\node [draw, thick, minimum size=1cm, circle] at (2,0) {};
\node [draw, thick, minimum size=1cm, circle] at (-1,0) {};

\node [draw, thick, minimum size=1cm, circle] at (1.5,-0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (0.5,-0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (-0.5,-0.85) {};

\node [draw, thick, minimum size=1cm, circle] at (1.5,0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (0.5,0.85) {};
\node [draw, thick, minimum size=1cm, circle] at (-0.5,0.85) {};

\node [draw, thick, minimum size=1cm, circle] at (1.0,2*0.85) {};
\draw[draw=none,fill=white!20](-1.5,2.0)--(2.5,2.0)--(2.5,2.5)--(-1.5,2.5);

\draw[dotted,thin](-1.5,-2)--(-1.5,2.0)--(2.5,2.0)--(2.5,-2)--(-1.5,-2);

\end{tikzpicture}
\caption{hhhhhhhhh}
\label{figspahre}
\end{figure}

\end{document}


Side notes:

The color description of white!20!white is meaningless. It says 20% of white mixed with 80% of white.

Instead of using white!20!white... \end{center}, use \centering`. This will remove some unwanted white space.

-