[pstricks] Drawing state diagrams

Runar Gjelsvik Runar.Gjelsvik at cern.ch
Thu Feb 17 10:29:22 CET 2005


That worked fine, thanks. But I get another problem:

When I want to add labels to the node connections all the labels are
placed on top of each other just right of the StoreRegs node. I've tried
adding [npos=xx] but it has no effect.

Runar

\psmatrix[mnode=circle,colsep=1,radius=10mm]
& & & \xst{ReadADC} \\
\xst{LoadFrame} & &  \xst{Idle} \\
& & & \xst{StoreRegs}
\endpsmatrix
\psset{shortput=nab,arrows=->,labelsep=3pt}
\small
\ncarc[arcangle=40,border=3pt]{2,3}{1,4}
\ncarc[arcangle=80,border=3pt]{1,4}{3,4}^{labelB}
\ncarc[arcangle=40,border=3pt]{3,4}{2,3}
\ncarc[arcangle=40,border=3pt]{2,3}{2,1}^{labelC}
\ncarc[arcangle=40,border=3pt]{2,1}{2,3} 

-----Original Message-----
From: pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] On
Behalf Of Herbert Voss
Sent: Wednesday, February 16, 2005 9:07 PM
To: pstricks at tug.org
Subject: Re: [pstricks] Drawing state diagrams

Runar Gjelsvik wrote:

> This works OK, BUT, the circles are of different sizes and that 
> doesn't look to good. I've tried to add mnodesize but it has no
affect.
> 
> I've managed to change the size of the circles by using:
> 
> \psmatrix[mnode=C,radius=1cm,colsep=1]
> 
> But in this case the text disappears, I only get white cirles.

the default for C

Herbert


\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-node}
\SpecialCoor
\pagestyle{empty}

\newlength\LWord\settowidth\LWord{LoadFrame}
\def\xst#1{\makebox[\LWord]{#1}}

\begin{document}

\psmatrix[mnode=circle,colsep=1,radius=10mm]
& & & \xst{ReadADC} \\
\xst{LoadFrame} & &  \xst{Idle} \\
& & & \xst{StoreRegs} \\
\endpsmatrix
\psset{shortput=nab,arrows=->,labelsep=3pt}
\small
\ncarc[arcangle=40,border=3pt]{2,3}{1,4}
\ncarc[arcangle=80,border=3pt]{1,4}{3,4}
\ncarc[arcangle=40,border=3pt]{3,4}{2,3}
\ncarc[arcangle=40,border=3pt]{2,3}{2,1}
\ncarc[arcangle=40,border=3pt]{2,1}{2,3}

\psmatrix[mnode=C,colsep=1,radius=.5\LWord]
& & & [name=ReadADC] \\[0pt]
[name=LoadFrame] & &  [name=Idle] \\
& & & [name=StoreRegs] \\
\endpsmatrix
\psset{shortput=nab,arrows=->,labelsep=3pt}
\small
\rput(ReadADC){ReadADC}\rput(Idle){Idle}
\rput(LoadFrame){LoadFrame}\rput(StoreRegs){StoreRegs}
\ncarc[arcangle=40,border=3pt]{2,3}{1,4}
\ncarc[arcangle=80,border=3pt]{1,4}{3,4}
\ncarc[arcangle=40,border=3pt]{3,4}{2,3}
\ncarc[arcangle=40,border=3pt]{2,3}{2,1}
\ncarc[arcangle=40,border=3pt]{2,1}{2,3}

\end{document}




--
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes

_______________________________________________
pstricks mailing list
pstricks at tug.org
http://tug.org/mailman/listinfo/pstricks




More information about the PSTricks mailing list