[R] radial.plot shaded region

Hodge, Steven Steven.Hodge at umassmed.edu
Wed Dec 11 00:33:23 CET 2013


I'm working with radial.plot in the plotrix package.

Is there a way to show a shaded region for a specific range of values in radial.lim?

For example:
# test data from radial.plot{plotrix}
testlen<-c(sin(seq(0,1.98*pi,length=100))+2+rnorm(100)/10)
testpos<-seq(0,1.98*pi,length=100)

# the original plot
radial.plot(testlen,testpos,rp.type="p",main="Test Polygon",line.col="blue")

# my attempt to shade the region between 3 and 3.5:
radial.plot(
	matrix(c(3.5, 3), byrow = TRUE),
	matrix(c(testpos, testpos), byrow = TRUE, nrow = 2),
	rp.type="p",
	main="Test Polygon",
	poly.col = c('light blue', 'white'),
	radial.lim = c(0, 3.5)
	)
# In effect, draw a polygon at 3.5 filled with light blue, then another at 3 filled with white.
# Now overplot the values of interest:
radial.plot(testlen,testpos,rp.type="p",main="Test Polygon",line.col="blue", radial.lim = c(0, 3.5), add = TRUE)

Is there an easier way? How can I re-draw the grid lines that are in the original plot?

Thanks,

Steve

. . . . . . . . . . . . . . .
Steven M. Hodge
Child and Adolescent Neurodevelopment Initiative S3-301
University of Massachusetts Medical School
55 Lake Avenue North
Worcester, MA 01655
Steven.Hodge at umassmed.edu



More information about the R-help mailing list