gpt4 book ai didi

r - geom_mosaic : X axis tick labels not showing?

转载 作者:行者123 更新时间:2023-12-04 12:36:38 24 4
gpt4 key购买 nike

我正在使用 ggmosaic::geom_mosaic生成马赛克图。我似乎无法让我的自变量的值标签显示在 X 轴上。该变量是一个标记因子,其水平标记为“1”、“2”、“3”。我确定这是愚蠢的事情,但我无法弄清楚这里发生了什么。任何见解将不胜感激。

ggplot(data = mosaic)+
geom_mosaic(aes(x = product(X, Norm_Dx), fill=Norm_Dx), na.rm=TRUE)

enter image description here

最佳答案

我建议您使用 mosaicplot .

mosaicplot(table(X, Norm_Dx))
更多信息请引用 this tutorial .

关于r - geom_mosaic : X axis tick labels not showing?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60894718/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com