Contour plot with filled colors (for x, y, z data)

조회 수: 6 (최근 30일)
Jake
Jake 2020년 4월 21일
댓글: Jake 2020년 4월 21일
Hello everyone!
I have a dataset that contains Latitude, Longitude and depth/height of a particular area. What I want to do is plat a contour map using the data and I'm more interested in the possiblity of reformatting the output contour map as following figure.
How can I achieve this using the original data set?
(A sample Data set is attached.)
TIA!
  댓글 수: 2
Mehmed Saad
Mehmed Saad 2020년 4월 21일
create your custom color map and apply on your contour. i think this will work
Jake
Jake 2020년 4월 21일
Could you recommend any reference, please? I'm still learning as I go.

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

답변 (1개)

KSSV
KSSV 2020년 4월 21일
x = A(:,1) ; y = A(:,2) ; z = A(:,3) ;
%%structured
xi = unique(x) ; yi = unique(y) ;
[X,Y] = meshgrid(xi,yi) ;
Z = reshape(z,size(X)) ;
figure
surf(X,Y,Z)
%%unstructured
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
figure
trisurf(tri,x,y,z)
For colormaps refer:
  댓글 수: 5
KSSV
KSSV 2020년 4월 21일
You can also use patch. I have shared a link right....check in there, do you have that colormap.
Jake
Jake 2020년 4월 21일
Thank you so much for providing the suggestions. They've been a huge help.
To clarify, I don't mind having different colors or a color bar than the one I have posted. My concern is getting the contour map generated as shown on the post.
Basically, the data refers to Lat, Lon and Depth/Altitude. I was interested in generatnig a contour map that shows different depths/altitudes based on that data set. (Although I'm questioning the possiblity of it at this point)
openExample('graphics/DisplayContourLabelsExample')
But I cannot generate that using my available data. Also, the plot only includes lines and legend/labels and it is not fully colored as I desired :(
Again, Thank you. If you have any more input, I'd appreciate but I'd understand if this is a dead end.

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

카테고리

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