Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove rectangle from Graphviz Dot cluster subgraph

Tags:

Is there a way to tell Dot to use a cluster but not show the rectangle around the subgraph nodes?

like image 529
mdashx Avatar asked Sep 09 '11 04:09

mdashx


2 Answers

You can do this with style.

Example using style=invis:

digraph g{  subgraph cluster0 {   style=invis;   1 -> 2;  } } 

If you'd like to use this as a default for all subgraphs, use subgraph[style=invis] :

digraph g{  subgraph[style=invis];   subgraph cluster0 {   1 -> 2;  } } 

Edit: 9 years later...

The best solution is to use

peripheries=0

This will actually prevent generating the rectangle in svg output, whereas penwidth=0 still includes a polygon (with stroke-width="0", but it's still there).

I've added this since this is the most upvoted answer.

like image 166
marapet Avatar answered Sep 28 '22 10:09

marapet


You can use style=invis:

subgraph cluster1 {   style=invis   ... } 

As an alternative to the style=invis approach above, you can also set pencolor=transparent (either locally or globally).

like image 23
ivanm Avatar answered Sep 28 '22 10:09

ivanm