This is because the external layer is a single column geom_tile, and the x value of geom_tile is a point, not a range.
The point multiply by the pwidth of the x range of the tree will return a constant.
But you can use the width of geom_tile to adjust the width of the single column geom_tile layer.
library(ggtree)
library(tidyverse)
library(ggtreeExtra)
library(ggnewscale)
tree <- read.tree(text='(((((((A:4,B:4):6,C:5):8,D:6):3,E:21):10,((F:4,G:12):14,H:8):13):13,((I:5,J:2):30,(K:11,L:11):2):17):4,M:56);')
Accession1 <- c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M')
Column1 <- c('10', '20', '30', '40', '50', '60', '70', '80', '90', '100', '110', '120', '130')
dd = data.frame(Accession1, Column1)
p <- ggtree(tree) + ylim(-1, NA)
fig <- p +
geom_tiplab() +
geom_fruit(
geom = geom_tile,
mapping = aes(fill = Accession1),
width = 2,
offset = 0.1
) +
new_scale_fill() +
geom_fruit(
geom = geom_tile,
mapping = aes(fill = Accession1),
width = 4,
offset = 0.08
)