I'm working on an illustration of a particular multiscale analysis method.
\begin{tikzpicture}[
scale=1.5,
circ/.style = {
circle,
draw,
black!75,
outer sep=0pt,
inner sep=1pt
}
]
\begin{scope}[step=0.5, very thin, black!30]
\draw [xshift=-2.5cm] (-0.9, -1) grid (1, 1);
\draw [] (-1, -1) grid (1, 1);
\draw [xshift=2.5cm] (-1, -1) grid (0.9, 1);
\end{scope}
\filldraw[fill=blue!40!white, fill opacity=0.5, draw=blue!50!white, very thin] (-0.5, -1) rectangle (0.5, 1);
\foreach \y in {-1, -0.5, 0, 0.5, 1} {
\foreach \x in {-0.5, 0, 0.5} {
\node [circ, fill=black!75] (enode) at (\x, \y) {};
}
\foreach \x in {-1.5, -1, 1, 1.5} {
\node [circ, fill=white] (bnode) at (\x, \y) {};
}
}
\end{tikzpicture}
The above code produces the following result:
I'm now, out of general interest and in an attempt to become better at TikZ, trying to put the finishing touches to the figure and try and fade the five hanging horizontal line segments of the left and right subdomains to white without affecting the rest of the subdomain.
My attempt to reproduce the answer by Ilhan Polat leads to an error that the counter variable \x
is undefined. Another answer, by Jean-Christophe Dubacq, to a similar question does not work as expected — I assume this is because the grid is not centered and transform
-ing the fade doesn't work either.
Could someone please lend a hand and explain how to do this in an elegant way, or, at all? Thanks in advance.
\documentclass
and the appropriate packages so that those trying to help don't have to recreate it. This is especially important fortikz
as there are numerous libraries and sometimes this takes time to figure out. – Peter Grill Aug 28 '18 at 18:46