R语言中绘图,将图例设置在绘图区域之外
001、 正常绘图
par(mar=c(6, 6, 6, 6), xpd = TRUE) ## 绘图区域外留白 plot(1:10) legend('right',inset= 0.3, pch=19,legend='xxx') ## 绘图,图例在图形内部
002、图例放在图形正右方
par(mar=c(6, 6, 6, 6), xpd = TRUE) plot(1:10) legend('right',inset= -0.3, pch=19,legend='xxx') ## 图例在正右方
003、图例在正左方
par(mar=c(6, 6, 6, 6), xpd = TRUE) plot(1:10) legend('left',inset= -0.3, pch=19,legend='xxx') ## 图例在正左方
004、图例在正上方
par(mar=c(6, 6, 6, 6), xpd = TRUE) plot(1:10) legend('top',inset= -0.3, pch=19,legend='xxx') ## 图例在正上方
005、精确调整
a、
par(mar=c(6, 6, 6, 6), xpd = TRUE) plot(1:10) legend('topleft',inset= c(0.4, 0.1), pch=19,legend='xxx') ## c(0.4, 0.1), 0.4调整横向,0.1调整纵向
b、
par(mar=c(6, 6, 6, 6), xpd = TRUE) plot(1:10) legend('topleft',inset= c(0.4, -0.1), pch=19,legend='xxx') ## 横向0.4, 纵向-0.1
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2022-04-04 ubuntu中 putty连接出现 network error. connection refused
2022-04-04 ubuntu中安装gcc c++编译器
2022-04-04 Peer reports incompatible or unsupported protocol version.
2022-04-04 cache.h:40:18: fatal error: zlib.h: No such file or directory
2022-04-04 bash: git: command not found...
2022-04-04 linux 中实现每两列数据合并为一列数据
2022-04-04 多组一列数据的处理