I read this. They suggest using transform canvas, which is rescaling but also it moves the picture where there is text (see figure). I also tried using \resizebox{}{}
or \scalebox{}{}
, bu that just makes the picture disappear.
This is how I generate the picture
\begin{center}
\begin{tikzpicture}[thick,scale=1.2,transform canvas={scale=1.2},
clear/.style={
draw=none,
fill=none
},
net/.style={
matrix of nodes,
nodes={ draw, circle, inner sep=10pt },
nodes in empty cells,
column sep=2cm,
row sep=-9pt
},
>=latex
]
% define matrix mat to hold nodes
% using net as default style for cells
\matrix[net] (mat)
{
% Define layer headings
|[clear]| \parbox{1.3cm}{\centering Input\\layer}
& |[clear]| \parbox{1.3cm}{\centering Hidden\\layer}
& |[clear]| \parbox{1.3cm}{\centering Output\\layer} \\
|[clear]| & & |[clear]| \\
& |[clear]| & |[clear]| \\
|[clear]| & &|[clear]| \\
& |[clear]| & |[clear]| \\
|[clear]| & & \\
& |[clear]| & |[clear]| \\
|[clear]| & & |[clear]| \\
& |[clear]| & |[clear]| \\
|[clear]| & & |[clear]| \\
};
\draw[-] (mat-3-1) -- node[above] {$s_t^1$} +(-1.5cm,0);
\draw[-] (mat-5-1) -- node[above] {$s_t^2$} +(-1.5cm,0);
\draw[-] (mat-7-1) -- node[above] {$s_t^3$} +(-1.5cm,0);
\draw[-] (mat-9-1) -- node[above] {$s_t^4$} +(-1.5cm,0);
% lines from a_{i}^{0} to each a_{j}^{1}
\foreach \ai in {3,5,...,9} {
\foreach \aii in {2,4,6,8,10}
\draw[-] (mat-\ai-1) -- (mat-\aii-2);
}
% lines from a_{i}^{1} to a_{0}^{2}
\foreach \ai in {2,4,6,8,10}
\draw[-] (mat-\ai-2) -- (mat-6-3);
% right most line with Output label
\draw[->] (mat-6-3) -- node[above] {Output} +(2cm,0);
\end{tikzpicture}
\end{center}
Does anyone have any ideas how to fix that?
transform canvas
is sort of a dirty trick that does not move the object, but moves the camera.\scalebox
, I believe, is also a camera-moving trick. It is pretty common that after several moving commands the camera is facing at somewhere out of bounds, hence you see nothing.