'How to change x axis in ggtree?

I've created a phylogenetic tree in R with the x axis set as branch length. I'd like to change this to number of substitutions. I have the column length from my alignment file

Image of my phylogenetic tree. The branch length is very small and not super intuitive so I want to change it to substitutions

edit: I discovered that xlim_expand changed the x axis but not the length of the branches.

  
columns <- ncol(ApmR_matrix) #getting count of columns in matrix

tree <- read.tree("tree_file") #loading in tree file

ggtree(tree) +  geom_tiplab(size =2) + theme_tree2() + geom_treescale()



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source