Question

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)
Was it helpful?

Solution

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))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top