# Plot augur refine tree with ggtree

**URL:** <https://nextstrain.discourse.group/t/plot-augur-refine-tree-with-ggtree/2017>\
**Category:** General\
**Created:** [January 21, 2026, 9:47am UTC](https://nextstrain.discourse.group/t/plot-augur-refine-tree-with-ggtree/2017 "2026-01-21T09:47:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![diegogotex](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diegogotex](https://nextstrain.discourse.group/u/diegogotex)\
**Post date:** [January 21, 2026, 9:47am UTC](https://nextstrain.discourse.group/t/plot-augur-refine-tree-with-ggtree/2017/1 "2026-01-21T09:47:43Z")

</div>

Hi all,

I’ve been trying to plot the calibrated tree from Augur Refine using GGTree in R, but the scale on the x-axis doesn’t match that on the Auspice visualisation.

I ran augur-refine with the following command:

```bash
augur refine \
        --tree $RESULTS/aligment.fasta.treefile \
        --alignment $RESULTS/aligment.fasta \
        --metadata $RESULTS/filtered_metadata.tsv \
        --output-tree $RESULTS/time_solved.tree \
        --output-node-data $RESULTS/time_solved_node_data.json \
        --timetree \
        --coalescent 'opt' \
        --date-confidence \
        --date-inference 'joint' \
        --root 'best' \
        --seed 1234567

```

and this is the tree when exported into auspice:

 ![Screenshot 2026-01-21 at 09.13.25](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/99836496dff020b2bab8ff0709c2c1b1cbb6a0cd.png)

So, in R, I’ve ran:

```r
tree <- read.newick("~/Desktop/Phylo/ML/results/time_solved.tree")

tree_plot <- ggtree(tree, 
                    mrsd="2025-10-08",
                    color="gray30")+
          theme_tree2()

tree_plot+
  expand_limits(y=-250)

```

 ![Screenshot 2026-01-21 at 09.23.21](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/ecff129f4314a78f20d76bd56772b92b138f219a.png)

The topology and branch length seem to be the same. However, the temporal scale on the x axis is different.

Therefore, I had to adjust the length of the tree to fit the temporal scale, reproducing an approximate scale of the Auspice visualisation by multiplying the length of the edges by 3270. _ **I tried multiple values before settling on this one, which seems to be the closest to the Auspice scaling.** _

```r
tree <- read.newick("~/Desktop/Phylo/ML/results/time_solved.tree")
tree$edge.length <- tree$edge.length * 3270

tree_plot <- ggtree(rsva_tree, 
                    mrsd="2025-10-08",
                    color="gray30")+
          theme_tree2()+
          expand_limits(y=-150)+
          scale_x_continuous(limits = c(1920,2026),
                     breaks = seq(1920,2025,by=5)
                     )

tree_plot

```

 ![Screenshot 2026-01-21 at 09.23.33](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/4d97475501a1e0464930a06721fb0c3d5b95bcba.png)

Does anyone know if there is a solution for importing and visualising exact values in ggtree?

Best regards,  
Diego

---

<div class="post-metadata">

**Author:** ![jonr](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@jonr](https://nextstrain.discourse.group/u/jonr)\
**Post date:** [February 4, 2026, 8:44pm UTC](https://nextstrain.discourse.group/t/plot-augur-refine-tree-with-ggtree/2017/2 "2026-02-04T20:44:16Z")

</div>

Maybe this thread will help? [How to get the correct time axis when using augur refine and timetree? - Nextstrain Discussion](https://nextstrain.discourse.group/t/how-to-get-the-correct-time-axis-when-using-augur-refine-and-timetree/2020/4)

I extracted “node\_dates” from each node in `branch_lengths.json` and then used the minimum and maximum node dates for calibrating the x-axis. I also calculated a “scale\_factor” which was the x-range (max node date - min node date) divided by the maximum tree height (max(node.depth.edgelength(tree))). I used plot.phylo from phytools though… Let me know if you need the exact code.

---

<div class="post-metadata">

**Author:** ![diegogotex](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diegogotex](https://nextstrain.discourse.group/u/diegogotex)\
**Post date:** [March 24, 2026, 10:31am UTC](https://nextstrain.discourse.group/t/plot-augur-refine-tree-with-ggtree/2017/3 "2026-03-24T10:31:38Z")

</div>

Hi @jonr

that worked! thanks for the help.

Best regards
