Control scale and colors in temperature contour
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ahmad
am 1 Apr. 2023
Kommentiert: Image Analyst
am 2 Apr. 2023
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')
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 1 Apr. 2023
You need to read in all the files first to determine the overall max and min. Then you can create a colormap and apply if to the files as you read them in again.
6 Kommentare
Image Analyst
am 2 Apr. 2023
Glad it's working for you. If this, or another, Answer solves your original question best, then could you please click the "Accept this answer" link to award the best answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Orange finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
