This question is a follow-up to How to scale a tikzpicture to \textwidth. Unfortunately I haven't been a member long enough to post comments in that thread to ask for clarification.
I have some figures that I've drawn with relative positioning commands like "right of" and "below of". It seems like when you use these, most of the typical scaling approaches don't work anymore. For an example, there's the simple flow chart from http://texample.net. I've included the code below in case the example changes in the future.
So, suppose I want to scale the figure from the example below. If I use
\begin{tikzpicture}[node distance = 2cm, auto, scale=0.5]
nothing happens. I've also tried the first method at the above link that scales a tikz figure to \linewidth
. It did not work for me. Can someone tell me how to make this type of figure
scale to some constant amount like I've shown, and
scale to
\linewidth
?
Example simple flow chart (modified) from
http://www.texample.net/tikz/examples/simple-flow-chart/
\documentclass[12pt,oneside, ]{report}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
%\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
minimum height=2em]
\begin{tikzpicture}[node distance = 2cm, auto]
% Place nodes
\node [block] (init) {initialize model};
\node [cloud, left of=init] (expert) {expert};
\node [cloud, right of=init] (system) {system};
\node [block, below of=init] (identify) {identify candidate models};
\node [block, below of=identify] (evaluate) {evaluate candidate models};
\node [block, left of=evaluate, node distance=3cm] (update) {update model};
\node [decision, below of=evaluate] (decide) {is best candidate better?};
\node [block, below of=decide, node distance=3cm] (stop) {stop};
% Draw edges
\path [line] (init) -- (identify);
\path [line] (identify) -- (evaluate);
\path [line] (evaluate) -- (decide);
\path [line] (decide) -| node [near start] {yes} (update);
\path [line] (update) |- (identify);
\path [line] (decide) -- node {no}(stop);
\path [line,dashed] (expert) -- (init);
\path [line,dashed] (system) -- (init);
\path [line,dashed] (system) |- (evaluate);
\end{tikzpicture}
\end{document}
\resizebox{\linewidth}{!}{<tikz picture>}
.\resizebox
scales everything, so I expected scaled text. Scaling everything but the text is much more difficult so I was asking if you need that.\noindent
right before your\resizebox
. Does that sound correct? Thanks.