1

I have been trying to map sound levels in multiple directions from a single sound source. I have average dB readings from 45 degree intervals around the source. I have plotted these using the polar.plot function in the plotrix package with my data represented as a polygon.

I would like to color the polygon so that higher values are more easily distinguished from lower ones using a color gradient (e.g. red for higher values, green for lower ones). I have attempted to do this using the color.scale function (also from plotrix).

>dB<-runif(9, min=17, max=24)
>azimuth<-seq(0,360,by=45)
>plot1<- polar.plot(dB,azimuth, main="Directional Signal Levels (dB)", start=90, clockwise=TRUE, rp.type="polygon",  radial.lim=c(0,24), poly.col=color.scale(dB,c(0,1,1), c(1,1,0),0), boxed.radial=FALSE)

However, this seems to only generate a solid red polygon.

Is there a way to get the polygon to use the specified color gradient I have provided? Or is there another package that will allow me to specify the color gradient for a polygon if this one will not?

0 Answers0