Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何删除R中绘图的空白部分?_R_Plot - Fatal编程技术网

如何删除R中绘图的空白部分?

如何删除R中绘图的空白部分?,r,plot,R,Plot,我有一个关于R图的问题。 问题是我把我的图形放在了绘图的中心,我想去掉它周围不必要的空白。 设置轴的限制没有帮助 我的R代码如下: visualize_circle_arrows <- function(x) { colors<- unlist(lapply(x$MeanOffsetLength,get_grey_color, max(x$MeanOffsetLength), min(x$MeanOffsetLength)), recursive = TRUE, use.name

我有一个关于R图的问题。 问题是我把我的图形放在了绘图的中心,我想去掉它周围不必要的空白。 设置轴的限制没有帮助

我的R代码如下:

visualize_circle_arrows <- function(x) {
  colors<- unlist(lapply(x$MeanOffsetLength,get_grey_color, max(x$MeanOffsetLength), min(x$MeanOffsetLength)), recursive = TRUE, use.names = TRUE)
  library(graphics)
  plot(x$IconCenterX, -x$IconCenterY, xlim=c(0, 1080), ylim=c(-1920, 0), asp=1, cex = .05, col = "blue", main="Offset vector for Thumb in warm",
       xlab="X coordinates of the screen, px", ylab="Y coordinates of the screen, px")
  radius <- rep(135,times=nrow(x)) 

  symbols(x$IconCenterX, -x$IconCenterY, circles=radius, add=TRUE, inches=FALSE, bg=colors)

  arrows(x$IconCenterX, -x$IconCenterY, x1 = x$MeanTouchX, y1 = -x$MeanTouchY, length = 0.04, angle = 25,
         code = 2, col = "black", lty = par("lty"),
         lwd = 2)
}

get_grey_color <- function(x,max=135, min=0) {
  value <- ((x+10-min)/(max+10-min))
  rgb(value, value, value)
}
visualize_circle_arrows(warm_thumb)

可视化\u圆圈\u箭头什么是clas
温暖的\u拇指
?一个可复制的示例会很有帮助。我的错,忘记把它放在那里了,我将在我的问题上附加一个快照。请使用
dput()
创建一个我们可以加载的示例数据集。我认为这里的问题在于对象的类别,它不能从你的截图中分析