Contour plot cutting off surface value?

5 次查看(过去 30 天)
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