[pstricks] [Fwd: Re: Graphs, combinatorics]

Herbert Voss herbert49 at googlemail.com
Tue Feb 27 16:52:10 CET 2007


-------- Original-Nachricht --------
Betreff: Re: Graphs, combinatorics
Datum: Tue, 27 Feb 2007 13:24:50 +0100
Von: Herbert Voss <herbert49 at googlemail.com>
Organisation: T-Online
Newsgruppen: comp.text.tex
Referenzen: <45e40367$0$565$426a34cc at news.free.fr>

marsu schrieb:
> Hello !
> 
> I'd like to know if whether there is an easy way to draw graphs with LaTeX..
> I'm talking about something like that :
> http://www.computing.dundee.ac.uk/website_images/research/hc.jpg
> 
> Obviously, I don't care about the colors... But I'd like to avoid typing every
> graph with metapost, with every coordinates, etc, etc ;)

\documentclass{article}

\usepackage{pst-node,multido}
\SpecialCoor

\def\colA#1{\ifcase#1red\or magenta\or yellow\or cyan\or green\or
blue\or gray\fi}
\def\colB#1{\ifcase#1blue\or gray\or red\or magenta\or yellow\or cyan\or
green\fi}
\pagestyle{empty}

\begin{document}

\begin{pspicture}(4,3)
\multido{\rA=90.0+51.429,\nA=0+1}{7}{\Cnode*[linecolor=\colA{\nA}](2.5;\rA){\nA2}}
\multido{\rA=90.0+51.429,\nA=0+1}{7}{%
  \Cnode*[linecolor=\colA{\nA}](2.5;\rA){\nA2}
  \Cnode*[linecolor=\colB{\nA}](1.25;\rA){\nA1}
  \ncline{\nA2}{\nA1}}
\multido{\nA=0+1,\nAA=1+1,\nB=3+1,\nC=4+1}{7}{%
  \ncline{\nA2}{\nAA2}\ncline{\nA1}{\nB1}\ncline{\nA1}{\nC1}}
\ncline{62}{02}
\end{pspicture}

\end{document}


Herbert



More information about the PSTricks mailing list