简体   繁体   English

如何编辑由使用图创建的其他函数生成的R图?

[英]How to edit R plots generated by other function that uses plot to create it?

I'm using the EFACompData from the package RGenData , which can create a plot. 我正在使用EFACompData软件包中的RGenData ,它可以创建绘图。 However, I want to remove the frame from that plot. 但是,我想从该绘图中删除框架。 How can I do it? 我该怎么做? The function EFACompData does not have an option to do it. 函数EFACompData没有执行此操作的选项。

x <- matrix(nrow = 200, ncol = 9)
for (i in 1:3) {
  shared <- rchisq(200, 1)
  for (j in 1:3) {
    x[, (i - 1) * 3 + j] <- shared + rchisq(200, 1)
  }
}

EFACompData(x, f.max = 5,graph = T)

Since EFACompData uses base graphics, you could try modifying graphical parameters via suitable par settings prior to calling the plot function. 由于EFACompData使用基本图形,因此您可以调用绘图函数之前尝试通过适当的par设置修改图形参数。 For example, 例如,

par(bty = "n")
EFACompData(x, f.max = 5, graph = TRUE)

will suppress the box surrounding the plot region. 将取消围绕绘图区域的框。 Of course, this only works if the plot function doesn't modify the parameter itself. 当然,这仅在plot函数未修改参数本身的情况下有效。 For EFACompData it works. 对于EFACompData它可以工作。 See help("par") for further graphical parameters. 有关更多图形参数,请参见help("par")

Note that subsequent "editing" of base graphics is limited to adding things to the current plot via low-level plotting commands such as points , lines , text , title , or legend . 请注意,对基础图形的后续“编辑”仅限于通过低级绘图命令(例如pointslinestexttitlelegend向当前绘图添加内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用R创建在一个绘图中合并3个绘图的函数 - How to create a function that combines 3 plots in one plot using R R:创建一个用户定义的函数来绘制数据然后导出图 - R: Create a User-defined Function that Plots data and then Exports the plot 如何创建一个在 R 中绘制径向线的函数? - How to create a function that plots radials in R? R ggplot:如何使用边际箱形图创建散点图 - R ggplot: How to create a scatter plot with marginal box plots 使用基础 R,如何创建一个“欢乐图”(又名山脊线图),其中许多分布相互重叠且垂直偏移? - Using base R, how to create a “joy plot” (aka ridgeline plots), with many distributions on top of each other with vertical offset? 如何在多个图中选择一个要编辑的图? - How to select one plot to be edit in multiple plots? 我想为两个样本创建经验累积分布函数,并将图放在同一图[R]中 - I want to create the empirical cumulative distribution function for two samples and put the plots in the same plot [R] 如何在 R 中使用函数获得的多个图创建演示文稿? - How to create a presentation in R with several plots obtained by a function? 如何在R中编辑刻面包裹的条形图 - How to edit facet wrapped bar plots in R 如何从 R 中的函数输出创建绘图 - How to create a plot from the output of a function in R
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM