# Layout in vertical column, with side notes

**URL:** <https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290>\
**Category:** Uncategorized\
**Created:** [August 5, 2020, 9:59pm UTC](https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290 "2020-08-05T21:59:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnAtl](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/johnatl/32/205_2.png) [@JohnAtl](https://forum.graphviz.org/u/JohnAtl)\
**Post date:** [August 5, 2020, 9:59pm UTC](https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290/1 "2020-08-05T21:59:56Z")

</div>

I’m new to Graphviz and dot. It seems ideal to separate content from presentation.

I would like to lay out a graph like this (created in OmniGraffle):

 ![Screen Shot 2020-08-05 at 5.51.47 PM](https://global.discourse-cdn.com/graphviz/original/1X/0c4c0d99e9a317d0606df7d1d6bab729d26aef21.png)

Graphviz/dot has it’s own opinion about this, and does this (sorry, I had to pixelate the text):

 ![Screen Shot 2020-08-05 at 5.58.35 PM](https://global.discourse-cdn.com/graphviz/original/1X/832f33ff93825ea10b1efbf8bca5fe9a319b1d22.png)

Is there a way to convince the layout engine that a certain line of items should be vertical, and other items would be adornments connected to those central items? (I did try `weight=n`, but it didn’t work consistently.)

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [August 6, 2020, 3:45am UTC](https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290/2 "2020-08-06T03:45:32Z")

</div>

If I understand what you’re after, I think this will help, but the more stylized you want your graph (the more you want to manage the positioning), the harder it becomes.  
[if you want to continue this, there probably is an anonymousizer program in your Graphizer package (probably in /usr/share/graphviz/gvpr)]  
digraph vert {  
graph [rankdir=“LR”]  
{  
rank=same  
x1 [label=“a note here”]  
x2 [label=“some parameters”]  
}  
{  
rank=same  
s1 [label= “Step 1”]  
s2 [label= “Step 2”]  
s3 [label= “Step 3”]  
}  
{  
rank=same  
of [label=“Output File”]  
}  
x1-\>s2  
x2-\>s3  
s1-\>s2-\>s3  
s2 -\> of [dir=backward]  
}  
 ![vertical1](https://global.discourse-cdn.com/graphviz/original/1X/ea6de7819dbb424c7365cef32cc6109ec2b12cef.png)

---

<div class="post-metadata">

**Author:** ![hans](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@hans](https://forum.graphviz.org/u/hans)\
**Post date:** [November 10, 2020, 3:57pm UTC](https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290/3 "2020-11-10T15:57:22Z")

</div>

Hi John,  
can you please post how to make the layout to be in two columns?  
Thanks!  
Hans

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [November 10, 2020, 9:58pm UTC](https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290/4 "2020-11-10T21:58:28Z")

</div>

Your request is kind of loose, but here is one solution in 2 columns:

```
digraph vert {
  graph [rankdir="LR"]
 {
  rank=same
  x1 [label="a note here"]
  of [label="Output File"]  
  x2 [label="some parameters"]  
 }
 {
  rank=same
  s1 [label= "Step 1"]
  s2 [label= "Step 2"]
  s3 [label= "Step 3"]
 }

 x1->s2
 x2->s3
 s1->s2->s3
 s2 -> of [dir=backward]
}

```

Giving:  
 ![verticalModified](https://global.discourse-cdn.com/graphviz/original/1X/74a5bf699d98e4ca033b220e706f6711e1f0baf9.png)

---

<div class="post-metadata">

**Author:** ![hans](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@hans](https://forum.graphviz.org/u/hans)\
**Post date:** [November 11, 2020, 10:08am UTC](https://forum.graphviz.org/t/layout-in-vertical-column-with-side-notes/290/5 "2020-11-11T10:08:56Z")

</div>

Sorry Steve, my request was related to the first post (especially the second image). I thought it would also refer to this. Thanks for your answer, but why do your solution doesn’t work with loose nodes like this?:

```
digraph vert {
  graph [rankdir="LR"]
 {
  rank=same
  x1 [label="a note here"]
  of [label="Output File"]  
  x2 [label="some parameters"]  
 }
 {
  rank=same
  s1 [label= "Step 1"]
  s2 [label= "Step 2"]
  s3 [label= "Step 3"]
 }

 #x1->s2
 #x2->s3
 s1->s2->s3
 #s2 -> of [dir=backward]
}
```
