Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rotating and scaling tikz Automata picutres

46 views
Skip to first unread message

Dave94705

unread,
May 25, 2021, 10:07:03 PM5/25/21
to
I cannot figure out how to scale or rotate an entire automata tikz picture.

Taking an example from page 577 of the manual, my approach clearly is not doing what I want -- to scale and rotate the entire figure. I have moved the scale=..., around within the [] too, but nothing seems to get what I want or expect. Am I (dense and) missing something or is scaling and rotating within automata harder than I thought or impossible? Thanks for any help, dave


\documentclass{article}
\usepackage{tikz}
\usetikzlibrary {arrows.meta,automata,positioning,shadows}

\begin{document}
\begin{tikzpicture}[%
scale=2, rotate= 90, % this line is my addition
shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]},thick,
every state/.style={fill,draw=none,orange,text=white,circular drop shadow},
accepting/.style ={green!50!black,text=white},
initial/.style ={red,text=white}]
\node[state,initial] (q_0) {$q_0$};
\node[state] (q_1) [above right=of q_0] {$q_1$};
\node[state] (q_2) [below right=of q_0] {$q_2$};
\node[state,accepting](q_3) [below right=of q_1] {$q_3$};
\path[->] (q_0) edge node [above left] {0} (q_1)
edge node [below left] {1} (q_2)
(q_1) edge node [above right] {1} (q_3)
edge [loop above] node {0} ()
(q_2) edge node [below right] {0} (q_3)
edge [loop below] node {1} ();
\end{tikzpicture}

\end{document}

Wasell

unread,
May 26, 2021, 3:35:07 AM5/26/21
to
You also need `transform shape', i.e.

scale=2, rotate= 90, transform shape, % etc

See section "17.7 Transformations".

Dave94705

unread,
May 26, 2021, 8:32:20 AM5/26/21
to
Thank you, that works nicely.
0 new messages