I have a graph drawn in tikz, in sperate tex file, that I call upon with an input, and a call to \TikzExampleLargeKtn{6}{1}{1}
(for instance). I'm not using tkz-graph
but I'm open to it.
\usepackage{tikz}
\usepackage{calc}
\usetikzlibrary{calc}
\tikzstyle{vertex}=[circle, draw, fill=black, inner sep=0pt, minimum size=3pt] %style of nodes.
\newcommand{\vertex}{\node[vertex]} %shorthand in place of \node[vertex]
\newcounter{Angle}
\newcommand{\TikzExampleLargeKtn}[3]{
\begin{tikzpicture}[x=#2 cm, y=#3 cm]
%creating a complete graph on #1 vertices
\foreach \i in {1, 2,..., #1} {
\setcounter{Angle}{ (\i-1) * 360 / #1}
\vertex (c\i) at (\theAngle:1) [label=\theAngle:]{};
}
%drawing the edges, I known every edge is defined twice but okay
\path
\foreach \i in {1, 2,..., #1} {
\foreach \j in {1, 2,..., #1} {
(c\i) edge[color=blue] (c\j)
}
};
%Adding an ellipse shape
\draw[fill=gray, opacity=0.2] (-2,0) ellipse (3 and 2);
\end{tikzpicture}
}
The output is a desired :
But now I would like to "attach" this construction at every vertices of another complete graph. The general output should be as follow, but the "gray/blue blob" being at each one of the 6 vertices of the red graph, and at the vertex touching the ellipse.
For info, I create the red graphs in a similar fashion, e.g.
\begin{tikzpicture}[x=4 cm, y=4 cm]
\foreach \i in {1, 2,..., 6} {
\setcounter{Angle}{ (\i-1) * 360 / 6}
\vertex (c\i) at (\theAngle:1) [label=\theAngle:]{};
}
\path %I known every edge is defined twice but okay
\foreach \i in {1, 2,..., 6} {
\foreach \j in {1, 2,..., 6} {
(c\i) edge[color=red,line width=\widthedge pt] (c\j)}};
\end{tikzpicture}
Is there any simplish way to do it ? I might have to review the way I draw these graphs entirely I guess. I based them from a simple rotation around (0,0) and it's not possible anymore.
tikzpicture
into atikzpicture
, strange/bad behaviours could happen. In this case, I think the proper thing to do is to create apic
that draws your graph, with all the arguments you need (including the coulour), and then to call it where and when needed.