在grid.curve中更改线的颜色和粗细. [R [英] Change line colour and thickness in grid.curve. R

查看:247
本文介绍了在grid.curve中更改线的颜色和粗细. [R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改使用grid.curve函数绘制的曲线的颜色和粗细?我尝试将参数添加到函数参数中,但不支持它们.我可以以某种方式更改默认par()吗?

How do I change the colour and thickness of the curve plotted with the grid.curve function? I've tried adding arguments to the function parameters but they're not supported. Can I somehow change the default par()?

library(grid)

plot.new()
#main viewport
vp=viewport(x=0.5,y=0.5,width=1, height=1)
pushViewport(vp)

#Circle
grid.circle(x=0.5, y=0.5, r=0.4)

grid.curve(0.5,0.9,0.9,0.5,curvature=arcCurvature(90),ncp=10)

推荐答案

想通了!

我必须添加参数gp = gpar(col ="red",lwd = 10).

I had to add the argument gp=gpar(col="red",lwd=10).

grid.curve(0.5,0.9,0.9,0.5,curvature=arcCurvature(90),ncp=10,gp=gpar(col="red",lwd=10))

这篇关于在grid.curve中更改线的颜色和粗细. [R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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