Plotting two different matrices one one axis
3 views (last 30 days)
Show older comments
- *I have two matrices below
1)Plotting depth**
Name: '/'
Dimensions: [1x2 struct]
Variables: [1x3 struct]
Attributes: [1x9 struct]
Groups: []
Format: 'classic'
Source:
D:\Dissertation\bathymetry data\GEBCO_2014_2D_69.5388_-2.3058_76.8447_2.7184.nc
Format:
classic
Global Attributes:
Conventions = 'CF-1.0'
title = 'The GEBCO_2014 Grid - a continuous terrain model for oceans and land at 30 arc-second intervals.'
institution = 'On behalf of the General Bathymetric Chart of the Oceans (GEBCO), the data are held at the http://www.gebco.net/data_and_products/gridded_bathymetry_data/'
references = 'Information on the data set is available from the GEBCO project web pages: http://www.gebco.net/data_and_products/gridded_bathymetry_data/'
comment = 'The data in the GEBCO_2014 Grid should not be used for navigation or any purpose relating to safety at sea.'
node_offset = 1
History = 'Translated to CF-1.0 Conventions by Netcdf-Java CDM (NetcdfCFWriter)
Original Dataset = /local/webassdata/grid/gebco/GEBCO_2014_2D_301801.nc; Translation Date = Wed Feb 14 16:56:52 GMT 2018'
Dimensions:
lat = 604
lon = 878
Variables:
elevation
Size: 878x604
Dimensions: lon,lat
Datatype: int16
Attributes:
standard_name = 'height_above_reference_ellipsoid'
long_name = 'Elevation relative to sea level'
units = 'm'
scale_factor = 1
add_offset = 0
sdn_parameter_urn = 'SDN:P01::BATHHGHT'
sdn_parameter_name = 'Sea floor height (above mean sea level) {bathymetric height}'
sdn_uom_urn = 'SDN:P06:ULAA'
sdn_uom_name = 'Metres'
coordinates = 'lat lon '
lat
Size: 604x1
Dimensions: lat
Datatype: double
Attributes:
standard_name = 'latitude'
long_name = 'latitude'
units = 'degrees_north'
axis = 'Y'
sdn_parameter_urn = 'SDN:P01::ALATZZ01'
sdn_parameter_name = 'Latitude north'
sdn_uom_urn = 'SDN:P06:DEGN'
sdn_uom_name = 'Degrees north'
_CoordinateAxisType = 'Lat'
lon
Size: 878x1
Dimensions: lon
Datatype: double
Attributes:
standard_name = 'longitude'
long_name = 'longitude'
units = 'degrees_east'
axis = 'X'
sdn_parameter_urn = 'SDN:P01::ALONZZ01'
sdn_parameter_name = 'Longitude east'
sdn_uom_urn = 'SDN:P06::DEGE'
sdn_uom_name = 'Degrees east'
_CoordinateAxisType = 'Lon'
2) Plotting Sea temperature
Global Attributes:
title = 'daily mean fields from Global Ocean Physics Analysis and Forecast updated Daily'
institution = 'MERCATOR OCEAN'
references = 'http://www.mercator-ocean.fr'
source = 'MERCATOR PSY4QV3R1'
Conventions = 'CF-1.0'
history = 'Data extracted from dataset http://opendap-glo.mercator-ocean.fr:8080/thredds/dodsC/global-analysis-forecast-phy-001-024'
time_min = 562788
time_max = 562788
julian_day_unit = 'hours since 1950-01-01 00:00:00'
z_min = 0.49402
z_max = 0.49402
latitude_min = -3
latitude_max = 3
longitude_min = 62
longitude_max = 75
Dimensions:
time = 1
depth = 1
latitude = 73
longitude = 157
Variables:
time
Size: 1x1
Dimensions: time
Datatype: single
Attributes:
long_name = 'Time (hours since 1950-01-01)'
standard_name = 'time'
calendar = 'gregorian'
units = 'hours since 1950-01-01 00:00:00'
axis = 'T'
_CoordinateAxisType = 'Time'
thetao
Size: 157x73x1x1
Dimensions: longitude,latitude,depth,time
Datatype: int16
Attributes:
_CoordinateAxes = 'time depth latitude longitude '
long_name = 'Temperature'
standard_name = 'sea_water_potential_temperature'
units = 'degrees_C'
unit_long = 'Degrees Celsius'
_FillValue = -32767
add_offset = 21
scale_factor = 0.00073244
cell_methods = 'area: mean'
longitude
Size: 157x1
Dimensions: longitude
Datatype: single
Attributes:
step = 0.083328
units = 'degrees_east'
unit_long = 'Degrees East'
long_name = 'Longitude'
standard_name = 'longitude'
axis = 'X'
_CoordinateAxisType = 'Lon'
latitude
Size: 73x1
Dimensions: latitude
Datatype: single
Attributes:
step = 0.083336
units = 'degrees_north'
unit_long = 'Degrees North'
long_name = 'Latitude'
standard_name = 'latitude'
axis = 'Y'
_CoordinateAxisType = 'Lat'
depth
Size: 1x1
Dimensions: depth
Datatype: single
Attributes:
units = 'm'
positive = 'down'
unit_long = 'Meters'
long_name = 'Depth'
standard_name = 'depth'
axis = 'Z'
_CoordinateAxisType = 'Height'
_CoordinateZisPositive = 'down'
I am plotting them using the code below
figure (1)
pcolor(lat,lon,temperature)
shading interp
colormap hot
colorbar
grid on
figure (2)
pcolor(lat,lon,elevation)
shading interp
surf(lat,lon,elevation)
colormap jet
colorbar
shading interp
grid on
title('Chagos Archipelago')
xlabel ('Latitude (^o)')
ylabel ('Longitude (^o)')
zlabel ('Elevation from sea surface level in meters')
colorbar
h = colorbar;
set(get(h,'label'),'string','Depth (m)');
*I would like to have the se temperature data as a 2D color plot at Z=0 on the 3D depth plot
Can anyone help*
1 Comment
Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!