Changing tick marks on geom_mosaic plot

我是研究僧i 提交于 2019-12-13 03:39:25

问题


I have the following dataset in R, which I want to make into a mosaic plot using ggplot2 and ggmosaic.

type   variable count residuals residcut residround
see.m       aca    44  4.380270     high          4
see.nm      aca    26 -3.063712      low         -3
see.m      conv    48 -1.562652      low         -2
see.nm     conv   135  1.092973   medium          1
see.m       fic    27 -2.194561      low         -2
see.nm      fic    98  1.534951   medium          2
see.m      news    17  1.504522   medium          2
see.nm     news    19 -1.052315      low         -1

I am using the following code, which gives me the plot below :

ggplot(see.reg2) + geom_mosaic(aes(x = product(type, variable), weight = count, fill = type))

I am wondering if there is a possible way to change the way the tick marks on the bottom are done, so that I only see four ticks: one for each level of 'variable', rather than seeing eight tick marks (one for each interaction).

Thank you!

来源:https://stackoverflow.com/questions/51677023/changing-tick-marks-on-geom-mosaic-plot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!