|
From: Jeff W. <js...@fa...> - 2006-01-25 13:21:06
|
Stephens, A (Ag) wrote: > Dear all, > > I am just looking at matplotlib for the first time and liking very much > what I see. I have a requirement to try and plot a horizontal scan from > a radar. The incoming data is simply array(distanceFromInstrument, > azimuth). Has anybody tried doing for a polar plot without converting > the data to a lat/lon grid first? > > An example of what I'd like to do is visible at: > > http://www.chilbolton.rl.ac.uk/weather/latest/latest_ppi_v2.png > > Thanks, > > Ag > Ag: You should be able to use either contourf or pcolor to make the plot by just passing it the X and Y coordinates of the radial distance, azimuth points. Here's a simple example: from pylab import * deltatheta = 2.*pi/100. theta = arange(0.,2.*pi,deltatheta) R = arange(0.,pi,deltatheta) r,t = meshgrid(R, theta) Z = sin(r)*sin(3.*t) X = r*cos(t) Y = r*sin(t) figure(figsize=(8,8)) cs = contourf(X, Y, Z) title('Simple polar contour plot') show() -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |