我尝试过使用 ggplot 和 ggforce(使用 facet_zoom),但我找不到方法。
以下是示例数据:
structure(list(name = c("other","Housing owner occupied","Housing rented","Housing owner living at home","Housing owner living elsewhere","Housing owner living in Brussels","Housing owner living outside Brussels"
),nbr = c(10000L,170000L,270000L,50000L,220000L,110000L,110000L),no_bar = c(1L,1L,2L,3L,3L)),class = "data.frame",row.names = c(NA,-7L))
这是我的 ggplot 图代码,但我没有缩放:
ggplot(data=d,aes(x=no_bar,y=nbr,fill=name)) +
geom_bar(stat="identity")