简体   繁体   中英

GraphViz dot Circular Node Alignment

How to use Graphviz to align nodes circular in clusters with additional text? Optionally with identical node positions (always 8 nodes per cluster)? 预期对齐

I tried circo , however, faced some shortcomings:

  • No clustering
  • No comments
  • Problems with margins for larger labels (10+ char)
  • Alignment varies with label size

This (Graphviz Online) , nothing spectacular, was the closest I could get. Any hints to other layouts (or even tools) appreciated.

graph {

layout = circo;

node [shape = circle,
      fontname = Helvetica,
      margin = 0]

edge [style=invis]

subgraph 1 {
a1 -- b1 -- c1 -- d1 -- e1 -- f1 -- g1 -- h1 -- a1
}

subgraph 2 {
a -- b -- c -- d -- e -- f -- g -- h -- a
}
}

Not exactly the answer as I was asking for (Graphviz), but I found a much nicer solution with MATLAB. It was about plotting a seating plan for an event.

座位图

What I did broken down:

  • imread() image of the floor plan
  • Roughly determined pixel spacing, used as x & y vector for image() so that tables are in scale with the room.
  • Manually defined centers for the clusters (here tables) with the help of ginput() (or imellipse() )
  • Plotted circles with plot() and added text with text()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM