Polar densityplot
Matias
I would like to plot a 3D polar plot or density polar plot I don't know how to call it (see attachement). I have a matrix (2500, 360) of point corresponding to Z intensity, each column corresponds to one degree and the row number to the radius (the number of row is the same for each columns). How can I do an image with? Should I change to cylindrical coordinate triplets or can I manage directly with this matrix?
Thanks for your help
Matias
Make/O/N=(2500, 360) polarMatrix
SetScale x, 0, 1, "radius", polarMatrix
SetScale/P y, 0, 1, "degrees", polarMatrix
polarMatrix= p*q
Make/O/N=(2500,2500) matrix
Variable radiusMax= DimOffset(polarMatrix,0)+DimDelta(polarMatrix,0)*(DimSize(polarMatrix,0)-1)
SetScale/I x, -radiusMax, radiusMax, "", matrix
SetScale/I y, -radiusMax, radiusMax, "", matrix
MultiThread matrix= FindZInPolarMatrix(polarMatrix,x,y)
End
ThreadSafe Function FindZInPolarMatrix(polarMatrix,x,y)
Wave polarMatrix
Variable x,y
Variable/C rTheta= r2polar(cmplx(x,y)) // cmplx(radius,angleinRadians)
Variable radius= real(rTheta)
Variable degrees= imag(rTheta)*180/pi
if( degrees < 0 )
degrees += 360 // assuming all angles in polarMatrix are >=0
endif
if( degrees > 359 )
degrees= 359 // assuming all angles in polarMatrix are <=359
endif
Variable radiusMax= DimOffset(polarMatrix,0)+DimDelta(polarMatrix,0)*(DimSize(polarMatrix,0)-1)
Variable radiusMin= DimOffset(polarMatrix,0)
Variable zVal= NaN
if( (radius >= radiusMin) && (radius <= radiusMax) )
zVal = polarMatrix(radius)(degrees)
endif
return zVal
End
See the attached graphic for the before and after with my demonstration data.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
June 1, 2011 at 03:35 pm - Permalink