Control scale and colors in temperature contour

1 回表示 (過去 30 日間)
Ahmad
Ahmad 2023 年 4 月 1 日
コメント済み: Image Analyst 2023 年 4 月 2 日
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')

採用された回答

Image Analyst
Image Analyst 2023 年 4 月 1 日
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 件のコメント
Ahmad
Ahmad 2023 年 4 月 2 日
Thanks for your help. I created my own colormap and it works fine
Image Analyst
Image Analyst 2023 年 4 月 2 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by