Change line colour and thickness in grid.curve. R

偶尔善良 提交于 2019-12-25 03:00:24

问题


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)

回答1:


Figured it out!

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))


来源:https://stackoverflow.com/questions/22775567/change-line-colour-and-thickness-in-grid-curve-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!