X-axis ticks on heatmap

2 次查看(过去 30 天)
Haozi
Haozi 2011-7-31
Hi,
I am learning to draw a heatmap in matlab. I can add x-axis labels or numbers. But I don't know how to add ticks on x-axis corresponding to the numbers. Can anyone help me with this? Thanks!
the set(gca,'XTick') works when you use plot but doesn't work for a heatmap object. :(

采纳的回答

the cyclist
the cyclist 2011-7-31
plot(1:10)
set(gca,'XTick',2:2:10)
  1 个评论
yakub sharif
yakub sharif 2020-2-11
doesn't work with mine
I am using the code
heatmapHandle = heatmap(surface_grid2, 'ColorMap', jet(100))
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
and want to label the x axis with floating numbers like 1:.5:10

请先登录,再进行评论。

更多回答(1 个)

Haozi
Haozi 2011-8-1
In the file exchange folder, there is a customerized heatmap function, that really solves the question. But still, thank you, the cyclist!

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by