I have 4 variables Latitude,longitude,depth of maximum salinity and maximum salinity, I would like to create a 3D plot with these variables for a single month. These variables are located in netcdf file and I have extracted them using the netcdf package, I have tried the surface plots but it did not gain any output. The data is in 3Dimension from which I have converted into 2 Dimension by collecting data of the same month.

댓글 수: 2

ANKUR KUMAR
ANKUR KUMAR 2017년 12월 22일
Do you want 3D plot or contour plot?
MIDHILA VARNA
MIDHILA VARNA 2017년 12월 23일
I need a contour plot of the variation of maximum salinity with the other 3 variables

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

 채택된 답변

ANKUR KUMAR
ANKUR KUMAR 2017년 12월 25일

2 개 추천

For the contour plot, you can use
contour(lon,lat,salinity')
If you want the filled contour plot, then you can use
contourf(lon,lat,salinity')
If you want labels on the contour plot, then you can use clabel

댓글 수: 3

MIDHILA VARNA
MIDHILA VARNA 2017년 12월 26일
The plot which you specified would give the variation of maximum salinity with longitude and latitude only , I would like to show the variation of salinity with depth,latitude,longitude(3 variables), would contour3 solve this problem?
ANKUR KUMAR
ANKUR KUMAR 2017년 12월 26일
편집: ANKUR KUMAR 2017년 12월 26일
You can use surf
surf(X,Y,Z,'FaceAlpha',0.5,'EdgeColor','none';)
X and Y should be the meshgrid of latitude and longitude
And in the same fashion, you can write contour3, but you will not get filled colors in contour3 (I think).
MIDHILA VARNA
MIDHILA VARNA 2017년 12월 26일
Thank you.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

질문:

2017년 12월 22일

편집:

2017년 12월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by