当我尝试这样做时:
# loading needed libraries
library(ggplot2)
library(ggforce)
# selecting variables to display
names <- as.vector(unique(mpg$manufacturer))
selected.names <- names[4:11]
# zooming in on the axes
ggplot(mpg, aes(x = manufacturer, y = class)) +
geom_jitter() +
facet_zoom(x = manufacturer %in% selected.names)
我没有得到放大的情节,而是
错误:facet_zoom 不支持缩放离散比例
(我有一个更详细的真实示例,但这很适合作为 MRE)
问题
如何放大分类数据?