# Recommend better way to show data graphically

**URL:** https://forum.graphviz.org/t/recommend-better-way-to-show-data-graphically/1785
**Category:** Help
**Created:** [September 12, 2023, 8:03pm UTC](https://forum.graphviz.org/t/recommend-better-way-to-show-data-graphically/1785 "2023-09-12T20:03:47Z")
**Posts on this page:** 1
**Showing post:** 8

<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: [September 23, 2023, 2:20pm UTC](https://forum.graphviz.org/t/recommend-better-way-to-show-data-graphically/1785/8 "2023-09-23T14:20:23Z")

</div>

[comment - these are great questions - not only are they clearly stated, they address common problems. My answers will be “best I can do”, but no guarantees, especially to Q1.]

Q1. In general, there is no way to _guarantee_ that edges don’t overlap nodes. But there are many ways to reduce the probability of this problem

- Layout engine choice - The **dot** engine attempts to minimize this problem and it provides attributes like **nodesep** and **ranksep** that further help. **Neato** is the engine with second-most attributes that _might_ help. Each engine approaches layout differently and is capable of producing a “best” result or a “worst” result, depending on the underlying graph, the attributes assigned in the input, and the “eye of the beholder”.

- graph-level

- node attributes -

Q2. Try

- **splines=ortho** (buggy but can produce some fine results),
- _do-it-yourself_ - many users use invisible nodes to create their own orthogonal edges
- I just announced a program that can create “simple” orthogonal edges ([A program to "fix" simple edges - #3 by steveroush](https://forum.graphviz.org/t/a-program-to-fix-simple-edges/1792/3)), but it is not capable of producing edges for a complex graph

Q3. You can produce edges between clusters and/or edges (for **dot** only, as I remember). You need add **compound=true** and then use the **lhead** and/or **ltail** attributes (see [https://www.graphviz.org/pdf/dotguide.pdf](https://www.graphviz.org/pdf/dotguide.pdf))  
Here is an example, and **whoops** there seems to be a new bug - I will report the bug later today,

```auto
digraph G {
  compound=true

  subgraph clusterA {
    a1 -> a2 -> a3
  }
  subgraph clusterB {
    b1 -> b2
    b1 -> b3
    b1 -> c2
  }
  a1 -> b2 [lhead=clusterB]
  c2 -> a3 [ltail=clusterB]
  b3 -> a3 [ltail=clusterB, lhead=clusterA]
}

```

Correct result:  
 ![compoundOK](https://global.discourse-cdn.com/graphviz/original/2X/f/f7b12e596f2db0b76799ead684d0bd04a46f8103.png)

Actual result:  
 ![compoundOKbug](https://global.discourse-cdn.com/graphviz/original/2X/8/8d0016af1136e15eeb0c5591d9af1fc22c760adf.png)

---

_[View the full topic](https://forum.graphviz.org/t/recommend-better-way-to-show-data-graphically/1785)._
