如何生成类似的图?[R]

如何生成类似的图?[R],r,ggplot2,data-visualization,R,Ggplot2,Data Visualization,本文的作者在他们的补充文件中提到,这些都是在Matlab中生成的。由于缺乏熟练程度、学习时间和许可证,我试图复制论文图2下方的图,特别是R中左侧的图2A: 有什么建议吗?这个情节一般叫什么 谢谢大家! 在我看来,这就像一个经典的点图!您可以使用ggplot在R中复制此类绘图: # Fake dataframe with xy coordinates, type of data (for the coloring), pvalue (for size), and different panel

本文的作者在他们的补充文件中提到,这些都是在Matlab中生成的。由于缺乏熟练程度、学习时间和许可证,我试图复制论文图2下方的图,特别是R中左侧的图2A:

有什么建议吗?这个情节一般叫什么


谢谢大家!

在我看来,这就像一个经典的点图!您可以使用ggplot在R中复制此类绘图:

# Fake dataframe with xy coordinates, type of data (for the coloring), pvalue (for size), and different panel
df <- data.frame(
  x = rep(1:20, 10),
  y = rnorm(200, mean = 0, sd = 2),
  type = rep(rep(LETTERS[1:5], each = 4), 10),
  pvalue = sample(0:50, size = 200, replace = T)/1000,
  panel = sample(rep(paste0("panel", 1:4), each = 50)), 200, replace = F)


# plot
library(ggplot2)
ggplot(df, aes(x, y*x , color = type, size = pvalue)) + geom_hline(yintercept = 0) + geom_point() + facet_wrap(~panel, ncol = 2)

ggsave("demo.png")

您是否有任何数据可供共享,以便更轻松地帮助您?这不是提示中建议的我的数据。在这种情况下,我尚未投反对票。然而,如果有类似于您的假数据,那么为您的问题提供工作代码将更容易。为了帮助你,我必须发明一些数据,希望它们可能与你的数据相似,并根据一些可能错误的数据创建一些代码。如果问题仅仅是如何将其称为“此图”,那么这个问题不符合所谓的标准,因为它与代码无关,可以关闭。数据有助于创建绘图。