Changing tick marks on geom_mosaic plot

627 Views Asked by At

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))

enter image description here

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!

0

There are 0 best solutions below