function contourmapgrid (data, xblocks, yblocks, interpmethod) % %contourmapgrid % %This plots the unevenly spaced data and gives a grid, as well as plots %the contours of the data. % %Wendy Bohon, March 09, 2009 %This clears the figure figure(3) clf %this brings up "help" and gives lots of instructions on griddata help griddata %tells griddata what the x and y grid looks like on which %it will operate-it's the easting/northing stepsize. %It needs to be positive, so if it ends up being negative %you need to take the absolute value, which is the "abs" command numsteps=100 estep = abs((min(e)-max(e))/numsteps); nstep = abs((min(n)-max(n))/numsteps); ee = [min(e):estep:max(e)]; nn = [min(n):nstep:max(n)]; %This grids the data. %the 'n means transpose N (switch it from a row vector to a column vector) % This was orginial [xi,yi,zi] = griddata(e,n,hh,ee,nn'); [xi,yi,zi] = griddata(e,n,h,ee,nn'); %this was orginial [c,h] = contour(xi,yi,zi,v); [c,h] = contour(xi,yi,zi); %this labels the contours %label contours clabel(c,h); colormap(jet) hold on %show data: plot(e,n,'o') %show grid: plot(xi,yi,'+') xlabel('easting') ylabel('northing') title('Contour Map') axis equal print('contourdatagrid.jpg','-djpeg'); end