问题
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