You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何放大persp3D绘图并使其铺满R的绘图窗口?

让persp3D图形铺满R绘图窗口的方法
  • 先指定绘图窗口尺寸
    在调用persp3D前用dev.new()自定义窗口的宽高,数值可根据你的屏幕实际情况调整:

    dev.new(width = 10, height = 8)
    require(plot3D)
    persp3D(z = sample_mean, theta = 120)
    

    新窗口打开后,绘图会自动适配这个窗口的大小。

  • 缩小图形边距
    利用persp3D的mar参数减少四周空白,四个数值分别对应下、左、上、右的边距,数值越小边距越窄:

    require(plot3D)
    persp3D(z = sample_mean, theta = 120, mar = c(1, 1, 1, 1))
    
  • 组合调整效果更佳
    把窗口尺寸和边距调整结合起来,能最大程度让图形占满窗口:

    dev.new(width = 12, height = 10)
    require(plot3D)
    persp3D(z = sample_mean, theta = 120, mar = c(0.5, 0.5, 0.5, 0.5))
    

如果用的是RStudio,也可以直接手动拖大绘图面板的尺寸,重新运行绘图代码,图形会自动适配新的面板大小。

内容的提问来源于stack exchange,提问作者freddywit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 12:25:19