How to create a Marimekko/Mosaic plot in ggplot2

后端 未结 7 843
我寻月下人不归
我寻月下人不归 2020-11-27 02:59

The Marimekko/Mosaic plot is a nice default plot when both x and y are categorical variables. What is the best way to create these using ggplot?

7条回答
  •  生来不讨喜
    2020-11-27 03:19

    You may use the ggplot2 extension package called "ggmosaic" (https://github.com/haleyjeppson/ggmosaic).

    Extensive tutorial with example code and visual results is given here https://cran.r-project.org/web/packages/ggmosaic/vignettes/ggmosaic.html.

提交回复
热议问题