# Direction of the tree layout

**URL:** <https://igraph.discourse.group/t/direction-of-the-tree-layout/1622>\
**Category:** Usage\
**Tags:** Python\
**Created:** [31 July 2023 22:48 UTC](https://igraph.discourse.group/t/direction-of-the-tree-layout/1622 "2023-07-31T22:48:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sophia0105](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/sophia0105/32/973_2.png) [@Sophia0105](https://igraph.discourse.group/u/Sophia0105)\
**Post date:** [31 July 2023 22:48 UTC](https://igraph.discourse.group/t/direction-of-the-tree-layout/1622/1 "2023-07-31T22:48:30Z")

</div>

Hi everyone!

I need to generate trees. I am using the reingold-tilford layout, but I can only make it work with trees from the bottom up to the top if I define a root node. Does anyone of you guys know how to display a tree starting at the top of the screen with node 0?

Thanks!  
Sophia

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [2 August 2023 15:59 UTC](https://igraph.discourse.group/t/direction-of-the-tree-layout/1622/2 "2023-08-02T15:59:23Z")

</div>

Just invert the layout after plotting by flipping the Y axis. The easiest is to call `layout.mirror(1)`:

```python
g = Graph.Tree(15, 2)
layout = g.layout("rt")
layout.mirror(1)

```
