MATLAB: Three dimensional plot using 4 variables

3d plots

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.

Best Answer

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
Related Question