Control scale and colors in temperature contour
Show older comments
im using this code to plot temperature contour from excel files, the issue is im doing it for different excel files so i want to have a unified scale and not auto scale because range is not the same for my files.so for example i want the range to be always between 28 and 36 . Also i would like to know if i can change/control the colors of the contour.
This is the code im using and ill also attach an example of the excel file im taking data from.
data = readmatrix('a.xlsx');
[m,n] = size(data);
% scale the x / y axis
% create x axis matching range : 0 to 220
% create y axis matching range : 0 to 50
x = (0:n-1)/(n-1)*220;
y = (0:m-1)/(m-1)*50;
% 2D data smoothing
matrixOut = smooth2a(data,10,10);
% or
% matrixOut = smoothn(data,50,'robust');
contourf(x,y,matrixOut);
colorbar('vert')
Accepted Answer
More Answers (0)
Categories
Find more on Red 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!