How do I extrapolate from my excel data to provide a smoother contour plot?
4 views (last 30 days)
Show older comments
Hi There,
I am attempting to plot what is essentially a contour plot of temperature distribution within the waters of a scottish loch. I have data we retrieved through temperature / salinty / depth analysis of the loch and am looking to plot this as a general contour plot using the limit of the basic bathymetry data to show the see bed. The idea would be to use this script to plot additional salinity / o2 conc data in the same excel doc. I need to a) make the contour plot smoother b) have my bathymetry plot colored correctly (it's currently got the sea brown and the seabed white) and . c)get matlab to extrapolate (to the limit of the bathymetry plot) and plot contours where no data has been supplied. I am unable to attach the excel sheet with the raw data but I can provide my code...
If need be I can mail the raw data data to whomsoever requires it...
thanks in advance
Les
% Define Microsoft Excel Spreadsheet
filename = 'Contour Plots.xlsx';
% Define temperature data set
sheet_number = 2;
% 2 - Temp; 3 - Sal; 4 - O2
xlrange_cont = 'B4:N144';
% Define Contour Plot
contour_plot = xlsread(filename,sheet_number,xlrange_cont);
% Plot Temp Contour Plot with colorbar and invert plot y axis for depth
subplot(1,1,1)
contourf (contour_plot);
set(gca,'YDir','reverse');
% Flips y axis for BOTH plots
colorbar;
hold on
% Bathymetry taken from event log (in m)
y = [39 5 52 60 74 13 146 140 88 43 25 1];
% Interpolate and smooth 'y' and define 'h' as area plot
x = 1:12;
subplot(1,1,1);
xx = 1:0.1:12;
yy = interp1(x,y,xx,'PHCIP');
h = area(xx,yy);
% Plot area and set colours and axes limits
area(h)
axis auto
xlim([1 12]);
ylim([1 150]);
set(h(1),'FaceColor',[0.5,0.25,0]); % wrong way round!!
hold off
% Add title and axis labels.
title('Temperature Distribution of Loch Etive(°C)')
ylabel('Depth (m)')
xlabel('Line of Bathymetry')
0 Comments
Answers (0)
See Also
Categories
Find more on Geology 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!