---
name: "unflatten"
section: "1"
platform: "linux"
package: "graphviz"
version: "16.1.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/unflatten"
---

# unflatten(1)

adjust directed graphs to improve layout aspect ratio

## NAME

unflatten - adjust directed graphs to improve layout aspect ratio

## SYNOPSIS

**unflatten** \[**-f?**\] \[**-l***len*\] \[**-c***len* \] \[ **-o** *outfile* \] \[ files \]

## DESCRIPTION

**unflatten** is a preprocessor to  **dot** that is used to improve the aspect ratio of graphs having many leaves  or disconnected nodes. The usual layout for such a graph is very wide or tall. **unflatten** creates chains with invisible edges or adjusts the **minlen** on edges to improve layout compaction.

## OPTIONS

The following options are supported:

- **-l** *len*

  The **minlen** of leaf edges is staggered between 1 and *len* (a small integer).

- **-f**

  Applies the **-l** option to fanout nodes whose indegree and outdegree are both 1. This helps with structures such as *a -\> {w x y z} -\> b*. This option only works if the **-l** flag is set.

- **-c** *len*

  Form disconnected nodes into chains of up to *len* edges.

- **-o** *outfile*

  causes the output to be written to the specified file; by default, output is written to **stdout**.

- **-?**

  Prints the usage and exits.

## OPERANDS

The following operand is supported:

- *files*

  Names of files containing 1 or more graphs in dot format. If no *files* operand is specified, the standard input will be used.

## AUTHORS

Stephen C. North \<north@research.att.com\>\
 Emden R. Gansner \<erg@research.att.com\>

## SEE ALSO

[gc(1)](/gc/1.md), [dot(1)](/dot/1.md), [acyclic(1)](/acyclic/1.md), [gvpr(1)](/gvpr/1.md), [gvcolor(1)](/gvcolor/1.md), [ccomps(1)](/ccomps/1.md), [tred(1)](/tred/1.md), libgraph(3)
