1

I am trying to draw the following image with tikz -

enter image description here

What exactly happens is it looks like the text box is like a layer on top of the matrix of objects. I want to make them appear as if they in the same layer. And I think I can achieve it if I am able to fade the border around the text box and make them fuzzy (fade gradually).

I tried to use the solutions from this question, but doesn't work.

Is it possible to do this?

The code goes as follows -

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,calc,shapes, positioning,shadows,shadows.blur,shapes.geometric}


\begin{document}

\scalebox{0.5}{
\begin{tikzpicture}
\tikzset{fontscale/.style = {font=\relsize{#1}}}
\newcommand{\mymacro}{
    % Axis
    \draw (-0.1,0) -- (1.0,0);
    \draw (0,-0.1) -- (0,0.5);

    \draw[fill=gray!50] (0.1,0.35) rectangle ++(0.2,0.2);
    \draw[fill=gray!50] (0.2,0.07) rectangle ++(0.4,0.2);

%    \node (rect) at (0.3,0.4) [draw,minimum height=0.05cm,minimum width=0.2cm,fill=gray!50] {};
%    \node (rect) at (0.5,0.2) [draw,minimum height=0.05cm,minimum width=0.3cm,fill=gray!50] {};
};

\begin{scope}
\foreach \x in {1,...,9}
{
\foreach \y in {1,...,9}
{
\begin{scope}[xshift=10\x cm,yshift=10\y cm]
        \mymacro
\end{scope}
}
}
\end{scope}

\begin{scope}[xshift=9cm]
\foreach \x in {1,...,9}
{
\foreach \y in {1,...,9}
{
\begin{scope}[xshift=10\x cm,yshift=10\y cm]
        \mymacro
\end{scope}
}
}
\end{scope}

\begin{scope}[xshift=18cm]
\foreach \x in {1,...,9}
{
\foreach \y in {1,...,9}
{
\begin{scope}[xshift=10\x cm,yshift=10\y cm]
        \mymacro
\end{scope}
}
}
\end{scope}

\begin{scope}[xshift=18cm,yshift=9cm]
\foreach \x in {1,...,9}
{
\foreach \y in {1,...,9}
{
\begin{scope}[xshift=10\x cm,yshift=10\y cm]
        \mymacro
\end{scope}
}
}
\end{scope}

\begin{scope}[yshift=9cm]
\foreach \x in {1,...,9}
{
\foreach \y in {1,...,9}
{
\begin{scope}[xshift=10\x cm,yshift=10\y cm]
        \mymacro
\end{scope}
}
}
\end{scope}

\begin{scope}[xshift=9cm,yshift=9cm]
\foreach \x in {1,...,9}
{
\foreach \y in {1,...,9}
{
\begin{scope}[xshift=10\x cm,yshift=10\y cm]
        \mymacro
\end{scope}
}
}
\end{scope}

\begin{scope}[xshift=115cm,yshift=110cm]
\node[draw,fill=white,scale=3,rounded corners] (temppicnode) {2 proc., 10 tasks$\approx$ 1000+ solutions};
        \clip (temppicnode.south west) rectangle (temppicnode.north east);
        \pgfmathsetmacro{\mybmax}{sqrt(2)*0.3}
        \pgfmathsetmacro{\mystep}{0.3/(20+1)}
        \pgfmathsetmacro{\myradstep}{sqrt(2)*0.3/(20+1)}
        \foreach \x [evaluate=\x as \mypred using \x-1] in {1,...,20}
        {   \pgfmathsetmacro{\myrad}{\mybmax-(\x-1)*\myradstep}
            \fill[white,even odd rule,opacity=0.1] ($(temppicnode.south west)+(-0.3,-0.3)$) rectangle ($(temppicnode.north east)+(0.3,0.3)$) [rounded corners=\myrad cm] ($(temppicnode.south west)+(\x*\mystep,\x*\mystep)$) rectangle ($(temppicnode.north east)+(-\x*\mystep,-\x*\mystep)$);
        }
        %\draw (temppicnode.north east) rectangle (temppicnode.south west);
        \fill[white,even odd rule] ($(temppicnode.south west)+(-0.3,-0.3)$) rectangle ($(temppicnode.north east)+(0.3,0.3)$) [rounded corners=0.3 cm] (temppicnode.south west) rectangle (temppicnode.north east);
\end{scope}

%\node[draw=none,fill=white,scale=3,text=white,rounded corners] at (115,110) {2 proc., 10 tasks$\approx$ 1000+ solutions};
%\node[draw=none,fill=white,scale=3] at (115,110) {2 proc., 10 tasks$\approx$ 1000+ solutions};

\end{tikzpicture}}
\end{document}
  • 1
    If you want, instead of \mymacro you can use pics (kind a macro mechanism provided by TiKZ) as I proposed in your previous question. You'll find some other examples in: tex.stackexchange.com/q/101200/1952 or tex.stackexchange.com/q/108132/1952 – Ignasi Oct 2 '14 at 8:06
  • I got an error while compiling - ! Package pgfkeys Error: I do not know the key '/tikz/myobject/.pic' and I am going to ignore it. Perhaps you misspelled it. – knowledge_seeker Oct 2 '14 at 8:13
  • you need TiKZ 3.0, which tikz version do you use? – Ignasi Oct 2 '14 at 8:15
  • i think its 2.10 – knowledge_seeker Oct 2 '14 at 8:24
  • Then you'll have to use \mymacro until you could consider to update it or update all your TeX system which I suspect is also outdated. – Ignasi Oct 2 '14 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.