【问题标题】:Combining ggplot2 with base plots in R: Looks and Syntax将 ggplot2 与 R 中的基图相结合:外观和语法
【发布时间】:2021-07-16 09:24:57
【问题描述】:

ggplot* 与基本 R 图在两个维度上有所不同:(1) 它们有许多语法和特征差异 (2) 它们看起来不同。

对于较长的论文,我经常希望对不同的图表使用不同的包,这仅仅是因为堆栈溢出的答案通常提供一种解决方案,而不是另一种解决方案。问题是长相太不协调了。

是否有让 ggplot* 图看起来更像基图的设置功能,反之亦然?

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    当我希望我的地块看起来像基础 R 地块时,我喜欢使用 ggthemes 中的 theme_base

    library(ggplot2)
    library(ggthemes)
    ggplot(mtcars, aes(x = hp, y = mpg)) +
            geom_point() +
            theme_base()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-05
      • 1970-01-01
      相关资源
      最近更新 更多