<p>Maybe try the following via gridExtra,</p>
<pre class="lang-r prettyprint-override"><code>library(gridExtra)
library(ggtree)
library(ape)
set.seed(2023-08-23)
my_tree &lt;- rtree(30)
p &lt;- ggtree(my_tree, mrsd='2022-12-31') %&lt;+% 
  metadato_arbol + 
  geom_tippoint(size = 2) + 
  theme_tree2() # + geom_text(aes(label=node))
gridExtra::grid.arrange(p, p %&gt;% rotate(33) %&gt;% rotate(52), ncol=2)
</code></pre>

CC BY-SA 4.0
2023-08-25T09:16:26.440Z
2023-08-25T14:01:44.147Z
2023-08-25T14:01:44.147Z
M__
<p>I'm editing a time-scaled tree using ggtree. The dates are correctly adjusted when I apply the 'mrsd' command and 'theme_tree2()', but when I try to rotate the tree with 'layout_dendrogram()', the scale still remains on the x-axis with no dates. Is there a way to place the date scale on the y-axis in a tree rotated with 'layout_dendrogram()'?</p>
<pre class="lang-r prettyprint-override"><code># Code without layout_dendrogram()
ggtree(my_tree, mrsd='2022-12-31') %&lt;+% 
  metadato_arbol + 
  geom_tippoint(size = 2) + 
  theme_tree2()
</code></pre>
<p><a href="https://i.sstatic.net/X6tco.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/X6tco.png" alt="enter image description here" /></a></p>
<pre class="lang-r prettyprint-override"><code># Using layout_dendrogram()
ggtree(my_tree, mrsd='2022-12-31') %&lt;+% 
  metadato_arbol + 
  geom_tippoint(size = 2) + 
  theme_tree2() + layout_dendrogram()
</code></pre>
<p><a href="https://i.sstatic.net/71BGk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/71BGk.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2023-08-25T01:05:44.820Z
Without a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) this is only a guess, but try substituting `theme_dendrogram()` for `theme_tree2()` and see you still get the same output.
jared_mamrot
<r><phylogenetics><ggtree>
Scale on the y-axis in a tree rotated with 'layout_dendrogram()' using ggtree
# Scale on the y-axis in a tree rotated with 'layout_dendrogram()' using ggtree

(Asked by: username_0 on 2023-08-24)

I'm editing a time-scaled tree using ggtree. The dates are correctly adjusted when I apply the 'mrsd' command and 'theme_tree2()', but when I try to rotate the tree with 'layout_dendrogram()', the scale still remains on the x-axis with no dates. Is there a way to place the date scale on the y-axis in a tree rotated with 'layout_dendrogram()'?
# Code without layout_dendrogram()
ggtree(my_tree, mrsd='2022-12-31') %<+% 
  metadato_arbol + 
  geom_tippoint(size = 2) + 
  theme_tree2()


# Using layout_dendrogram()
ggtree(my_tree, mrsd='2022-12-31') %<+% 
  metadato_arbol + 
  geom_tippoint(size = 2) + 
  theme_tree2() + layout_dendrogram()

**Tags:** r, phylogenetics, ggtree
> **Comments:**
> **username_1**: Without a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) this is only a guess, but try substituting `theme_dendrogram()` for `theme_tree2()` and see you still get the same output.  

---

## 1 answers

### Answer by username_2 on 2023-08-25. Score: 0

Maybe try the following via gridExtra,
library(gridExtra)
library(ggtree)
library(ape)
set.seed(2023-08-23)
my_tree <- rtree(30)
p <- ggtree(my_tree, mrsd='2022-12-31') %<+% 
  metadato_arbol + 
  geom_tippoint(size = 2) + 
  theme_tree2() # + geom_text(aes(label=node))
gridExtra::grid.arrange(p, p %>% rotate(33) %>% rotate(52), ncol=2)


---

