How may I rotate a tikzpicture?
You can use the rotate key, but you also need transform shape
or nodes are not rotated:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
%\pagestyle{empty}
\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=gray!20, text width=7.5em, rounded corners, minimum height=4.1em]
\tikzstyle{blocks} = [rectangle, fill=white!20, text width=9em, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [ellipse,fill=white!20, node distance=2cm,
minimum height=2em]
\begin{tikzpicture}[node distance = 2cm, auto,rotate=90,transform shape]
%\node [block] (initial) {Initial text};
\node [block] (beginning) {{\tiny Beginning}};
\node [cloud, below of =beginning] (decide) {Reactions};
\node [block, below of=decide, node distance=3cm](stop){{\tiny \textbf{Second alternative}: Wait }};
\node[block, left of =stop, node distance=3cm](left){{\tiny \textbf{First alternative}: Continue}};
\node[block, right of =stop, node distance=3cm](right){{\tiny \textbf{Third alternative}: Give in }};
\node[blocks, below of =left, node distance=2cm](node name){{\large Logo}};
%\path [line] (initial) -- (evaluate);
\path [line] (beginning) -- (decide);
\path [line] (decide) -- node {}(stop);
\path [line](decide)--(right);
\path [line](decide)--(left);
\end{tikzpicture}
\end{document}
Funny solution: Wrapping a tikzpicture
in a tikzpicture
node which is rotated by 90 degrees:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
%\pagestyle{empty}
\tikzset{
,decision/.style=
{
diamond, draw, fill=blue!20, text width=4.5em, text badly centered,
node distance=3cm, inner sep=0pt
}
,block/.style=
{
rectangle, draw, fill=gray!20, text width=7.5em, rounded corners,
minimum height=4.1em
}
,blocks/.style=
{
rectangle, fill=white!20, text width=9em, rounded corners,
minimum height=4em
}
,line/.style={draw, -latex'}
,cloud/.style={ellipse,fill=white!20, node distance=2cm, minimum height=2em}
}
\begin{tikzpicture}
\node[rotate=90] at (0,0) {
\begin{tikzpicture}[node distance = 2cm, auto]
%\node [block] (initial) {Initial text};
\node [block] (beginning) {{\tiny Beginning}};
\node [cloud, below of =beginning] (decide) {Reactions};
\node [block, below of=decide, node distance=3cm](stop){{\tiny \textbf{Second alternative}: Wait }};
\node[block, left of =stop, node distance=3cm](left){{\tiny \textbf{First alternative}: Continue}};
\node[block, right of =stop, node distance=3cm](right){{\tiny \textbf{Third alternative}: Give in }};
\node[blocks, below of =left, node distance=2cm](node name){{\large Logo}};
%\path [line] (initial) -- (evaluate);
\path [line] (beginning) -- (decide);
\path [line] (decide) -- node {}(stop);
\path [line](decide)--(right);
\path [line](decide)--(left);
\end{tikzpicture}
};
\end{tikzpicture}
\end{document}
With standalone
document class as cropping element instead of preview
package, you can include the tikzpicture
inside a rotatebox
command to get the desired result.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
%\usepackage[active,tightpage]{preview}
%\PreviewEnvironment{tikzpicture}
\begin{document}
%\pagestyle{empty}
\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=gray!20, text width=7.5em, rounded corners, minimum height=4.1em]
\tikzstyle{blocks} = [rectangle, fill=white!20, text width=9em, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [ellipse,fill=white!20, node distance=2cm,
minimum height=2em]
\rotatebox{90}{%
\begin{tikzpicture}[node distance = 2cm, auto]
%\node [block] (initial) {Initial text};
\node [block] (beginning) {{\tiny Beginning}};
\node [cloud, below of =beginning] (decide) {Reactions};
\node [block, below of=decide, node distance=3cm](stop){{\tiny \textbf{Second alternative}: Wait }};
\node[block, left of =stop, node distance=3cm](left){{\tiny \textbf{First alternative}: Continue}};
\node[block, right of =stop, node distance=3cm](right){{\tiny \textbf{Third alternative}: Give in }};
\node[blocks, below of =left, node distance=2cm](node name){{\large Logo}};
%\path [line] (initial) -- (evaluate);
\path [line] (beginning) -- (decide);
\path [line] (decide) -- node {}(stop);
\path [line](decide)--(right);
\path [line](decide)--(left);
\end{tikzpicture}
}
\end{document}