1

I have a set of data that I'm trying to create a surface plot of. I have an x,y point and a to colour by.

I can create a xy plot with the points coloured but I can't find a way to create a surface plot with my data. The data isn't on a normal grid and I would prefer to not normalize it if possible (or I could just use a very fine grid).

The data won't be outside the a radius=1 circle so this part would need to be blank.

The code and the plot is shown below.

I've tried using contour, filled.contour as well as surface3d (not what I wanted). I'm not real familiar with many packages in R so I'm not even sure where to begin looking for this info.

Any help in creating this plot would be appreciated.

thanks, Gordon

dip<-data.frame(dip=seq(0,90,10))
ddr<-data.frame(ddr=seq(0,350,10))
a<-merge(dip,ddr)
a$colour<-hsv(h=runif(nrow(a)))

degrees.to.radians<-function(degrees){
  radians=degrees*pi/180
  radians
}

a$equal_angle_x<-sin(degrees.to.radians(a$ddr))*tan(degrees.to.radians((90-a$dip)/2))
a$equal_angle_y<-cos(degrees.to.radians(a$ddr))*tan(degrees.to.radians((90-a$dip)/2))

plot(a$equal_angle_x,a$equal_angle_y,col=a$colour,lwd=10)

enter image description here

With regards to the plot I was trying to create is below. I believe the link in the first comment should get me where I'm trying to go.

enter image description here

gtwebb
  • 2,981
  • 3
  • 13
  • 22
  • 3
    have a look at the code here: http://stackoverflow.com/questions/10856882/r-interpolated-polar-contour-plot and perhaps you can modify for your situation – tim riffe Dec 06 '13 at 01:06
  • That's a truly ugly and probably uninformative plot. What feature of the synthetic data were you hoping this effort would produce? – IRTFM Dec 06 '13 at 02:40
  • The use of a random colour probably wasn't the best choice as it wouldn't build a good surface. I'll post another picture to show the desired result. I was trying to create code containing just the problem I needed help with and not all the other calcs. – gtwebb Dec 06 '13 at 16:53

0 Answers0