Contour plot cutting off surface value?

조회 수: 10 (최근 30일)
aaron Harvey
aaron Harvey 2016년 3월 23일
댓글: aaron Harvey 2016년 3월 23일
Hi i have a contour plot showing a depth profile of nutrients in the ocean over time however when using meshgrid to interpolate it doesn't seem to be calculating any values for the upper most layer?
[xq,yq] = meshgrid(min(date):1/12:max(date),-4000:100:0);
varq = griddata(date,-depth,var,xq,yq);
[hc hc]=contourf(xq,yq,varq,N-1);
using the above code it plots a contour map from -4000m up to -100m but only white space from -100m to 0m? The only way i have been able to change this is by changing the steps in the meshgrid from -4000:100:0 to -4000:0 however this creates a very grainy contourplot and ideally i would like to keep the averaged smoother plot? how can i do this without loosing the surface data?
  댓글 수: 1
aaron Harvey
aaron Harvey 2016년 3월 23일
Thank-you for your reply however i'm definitely not reaching the resolution of my data. here's a simple scatter(date,depth,z)
and here's my rubbish contour plot that cutting of the top 100m?

댓글을 달려면 로그인하십시오.

답변 (1개)

Mike Garrity
Mike Garrity 2016년 3월 23일
We don't have access to your data, so we can only guess, but ...
When you say that increasing the grid resolution makes the contour "grainier", then my guess would be that you're not interpolating at all. My guess would be that you are actually approaching the resolution of your input data, and that the coarser grid is simply subsampling.
I would suggest comparing your gridded data with your original data by combining a surface and a scatter, as I showed in the thread for this question. You can do that for a subset of your data if it's large. If the high-res grid is comparable to the spacing of your original data points, then I think you need to be careful about how you go down to the low-res grid. You would really want to low-pass filter to make sure you're not aliasing any high frequencies in your data.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by