gpt4 book ai didi

r - 将 ggplot2 与 R : Looks and Syntax 中的基本图相结合

转载 作者:行者123 更新时间:2023-12-04 13:08:09 25 4
gpt4 key购买 nike

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

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

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

最佳答案

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

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

enter image description here

关于r - 将 ggplot2 与 R : Looks and Syntax 中的基本图相结合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68406650/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com