如何在ggplot2中为treemap的标签文本设置相同的大小

How to set same size for label text of treemap in ggplot2

我使用以下代码绘制了树状图:

library(treemap)
library(ggplot2)
ggplot2::ggplot(G20, ggplot2::aes(area = gdp_mil_usd, fill = econ_classification,label = country), size = 4) +
  geom_treemap() +
  geom_treemap_text(grow = T, reflow = T, colour = "black", place = "centre", family = "STKaiti", size = 4)

输出:

现在我想知道是否可以设置相同大小的标签文本,我在ggplot()geom_treemap_text()中添加了参数size = 4,但是没有用。

有人可以帮忙解决这个问题吗?谢谢。

geom_treemap_text中设置grow=FALSE

library(treemapify)
library(ggplot2)
ggplot2::ggplot(G20, ggplot2::aes(area = gdp_mil_usd, 
               fill = econ_classification, label = country)) +
  geom_treemap() +
  geom_treemap_text(grow = F, reflow = T, colour = "black", 
                    place = "centre", family = "STKaiti", size = 14)