I want to plot a 2-graph, the Königsberg graph. I've got this: V={A,B,C,D} the set of vertices E={e1={A,B}, e2={A,B}, e3={A,D}, e4={C,D}, e5={B,C}, e6={B,C}, e7={B,D}} the set of nodes (axis, aristas)


  • 4
    What is a 2-graph? – percusse Sep 29 '14 at 20:15
  • @percusse Maybe the OP means a planar graph... – jub0bs Sep 29 '14 at 20:48
  • What have you tried? Do you know of the graphs TikZ library (section 19 in the doc)? – jub0bs Sep 29 '14 at 20:51
  • @percusse 2-graph is a graph where every node has got 2 axis – Tobal Oct 1 '14 at 19:50
  • It's meant to emphasize that this is not a math site so it needs some context. – percusse Oct 1 '14 at 21:00

You can do that with pst-eucl, if you want to give a try at pstricks. Here is a short code, compilable with pdflatex if you use the shell-escape (TeX Live, MacTeX) or --enable-write18 (MiKTeX) switch:

\documentclass[12pt, pdf, x11names]{article}%



\begin{pspicture*}(-1, -1.2)(2, 1.2)
\psset{linewidth=0.5pt, linecolor=SteelBlue3, fillcolor=SteelBlue3, PointNameSep=0.8em}
\pstGeonode[PointSymbol=none, PointName=none](0.5,-0.5){O1}(-0.5, -0.5){P1}(0.5,0.5){O2}(-0.5,0.5){P2}
\pstGeonode[PointSymbol=o, PosAngle={180,180,180,0}](0,-1){A}(0,0){B}(0,1){C}(1.5,0){D}
\ncline{A}{D} \ncline{B}{D} \ncline{C}{D}


enter image description here

| improve this answer | |
  • I've got a lot of error messages with miktex2.9. I've installed all pst packages. – Tobal Sep 30 '14 at 6:32
  • 1
    @Tobal: I forgot to mention that you have to launch pdflatex with the --enable-write18 switch. I suppose it's the problem. Could you confirm that, please? – Bernard Sep 30 '14 at 8:33
  • this is not the problem. In a message I obtain SteelBlue3 is not defined. – Tobal Sep 30 '14 at 15:11
  • Strange… It's defined in the x11names module of xcolor (p. 40 of the doc) wich is loaded by pstricks, which is loaded by pst-eucl. That's why it is among the class options (to avoid optionsloading conflicts). Just in case, load xcolor (but x11names must remain a class option). – Bernard Sep 30 '14 at 15:19
  • 1
    Let us continue this discussion in chat. – Bernard Sep 30 '14 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.