I'm trying to scale the whole picture but it's not working.
\begin{tikzpicture} [scale=0.5, every node/.style={transform shape}]
\tikzstyle{startstop} = [ellipse, draw=orange, thick, fill=orange!20, text width=5em, minimum height=4em, text centered, dashed]
\tikzstyle{block} = [rectangle, draw=blue, thick, fill=blue!20, text width=8em, minimum height=4em, shape aspect=2, text centered, rounded corners]
% Define nodes in a matrix
\matrix [column sep=10mm, row sep=7mm]
{
\node [startstop] (Signal) {Trama de la señal};
&\node [block] (DFT) {Transformada Discreta de Fourier};
&\node [block] (Module) {Módulo};
&\node [block] (MelFilt) {Filtros Mel}; \\
\node [startstop] (MFCC) {MFCC};
&\node [block] (Lifter) {Lifter};
&\node [block] (IDCT) {Transformada Discreta Inversa de Coseno};
&\node [block] (Log) {Logaritmo}; \\
};
\node [draw, scale=1, rectangle, dashed, thick, fit=(DFT) (Module) (Log) (Lifter) (IDCT)] {};
% connect all nodes DFT above
\begin{scope} [every path/.style={line, line width=1.3pt} ]
%Down Lines
\path (Signal) -- (DFT);
\path (DFT) -- (Module);
\path (Module) -- (MelFilt);
\path (MelFilt.south) -- (Log.north);
\path (Log) -- (IDCT);
\path (IDCT) -- (Lifter);
\path (Lifter) -- (MFCC);
\end{scope}
\end{tikzpicture}
And when I replace transform shape for scale=0.5, the fitting fails.
Best Answer
I think the issue is the matrix. As soon as I switched to regular nodes, it started working better. I also don't think a matrix is the appropriate tool here since it works a bit differently. Alternatively, I'd suggest using the
chains
library which will also get rid of the extra line commands below. Finally, you can remove thefit
library and usecalc
to draw a fitting rectangle around the nodes (you only needed two by the way for fitting them).Of course, now it scales better!
Output
Code