更改箭头的箭头() [英] Change arrowhead of arrows()

查看:54
本文介绍了更改箭头的箭头()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以更改用 arrows() 绘制的箭头的箭头.我查看了文档,但我发现我可以更改行尾但不能更改箭头?

i wonder if it is possible to change the arrowhead of an arrow drawn with arrows(). I looked through the documentation but all I found is that I can change the end of a line but not of an arrow?

plot(c(1:10))
arrows(0,0,10,10)

感谢任何帮助:)

推荐答案

?arrow 中所述,您可以使用 lengthangle更改标准箭头的外观.使用 lwd 你可以改变粗细,就像在 lines() 中一样.lty 也可以工作,尽管结果通常不太好.

as explained in ?arrow , you can use length and angle to change the appearance of standard arrows. With lwd you can change the thickness, exactly like in lines(). Also lty works, although the result is often not exactly nice.

一整套例子:

plot(c(0:10),type="n")

arrows(1,0,2,1,length=0.2,angle=20)
arrows(1,1,2,2,length=0.1,angle=40,lwd=3)

invisible(mapply(arrows,
        rep(c(3,6),each=4),rep(3:6,2),
        rep(c(5,8),each=4),rep(5:8,2),
        angle=seq(10,40,length.out=8),
        length=rep(seq(0.1,0.3,length.out=4),2),
        lwd=rep(1:4,each=2))
)

这篇关于更改箭头的箭头()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆