フィルターのクリア

How can I change the axis values on a heatmap?

26 ビュー (過去 30 日間)
Behrad Ze
Behrad Ze 2023 年 1 月 2 日
回答済み: Image Analyst 2023 年 1 月 2 日
I would like to plot a heatmap from an excel file.the first row and column of the excel file are my axis values. I can plot the figure from the file. However, the values which are shown for X and Y axis are not the values I want to have.I also want to change the interpreter of the plot Latex.I would be very thankful if anyone could help me in this regard. I have also attached the sample file and the plot I have drawn. I am using the code as below:
csvfiles = dir('*.csv');
for file = csvfiles'
sample=readmatrix(file.name)
x=sample(1:end,1);
y=sample(1,1:end);
xString=string(x);
yString=string(y);
dataSample=sample(1:end,2:end)
heatmap(dataSample);
caxis([0, 80]);
end
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2023 年 1 月 2 日
Can you share the expected result (pictorial)?

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

採用された回答

Image Analyst
Image Analyst 2023 年 1 月 2 日
Use the XDisplayLabels property:
h = heatmap([1 3 5; 2 4 6])
h =
HeatmapChart with properties: XData: {3×1 cell} YData: {2×1 cell} ColorData: [2×3 double] Show all properties
h.Title = 'My Heatmap Title';
h.XDisplayLabels = {'a'; 'b'; 'c'};
h.YDisplayLabels = {'y'; 'z'};
fontsize(gca, 20, 'points')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by