Testing tikz


Text is OK after the figure, but before it does not work. I would also like to know how to center the resulting fig

% Define block styles
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, fill=red!25]

\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node distance=2.8cm, semithick]
  \node [astate] (1) at (0,0) {1};
  \node [astate] (2) at (1,0) {2};
  \node [rstate] (3) at (2,0) {3};
  \path (1) edge [bend left] node {b} (2)
        (2) edge node {b} (3)
        (2) edge [bend left] node {a} (1)
        (3) edge [loop above] node {(a, b)} (3);



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s