How to control ggplot's plotting area proportions instead of fitting them to devices in R?

前端 未结 3 1572
星月不相逢
星月不相逢 2021-01-03 03:26

By default, each plot in ggplot fits its device.

That\'s not always desirable. For instance, one may need to make tiles in geom_tile to be

3条回答
  •  执念已碎
    2021-01-03 04:01

    Here's an easy device to treat your plot with respect,

    library(ggplot2)
    p = qplot(1:10, (1:10)^3)
    g = ggplotGrob(p)
    g$respect = TRUE
    library(grid)
    grid.draw(g)
    

提交回复
热议问题