How to sort heatmap columns based on outside data

Hi,
I plotted a heatmap as shown below:
h = heatmap(array);
I want to sort my columns based on some outside data, specifically an array called idx shown below. How can I do this?
Thanks.

 채택된 답변

Voss
Voss 2022년 5월 21일
array = rand(13,28);
idx = [13 5 24 23 17 15 3 12 1 25 26 4 18 10 27 14 21 7 20 19 8 28 11 2 6 22 16 9];
h = heatmap(array(:,idx),'XDisplayLabels',sprintfc('%d',idx));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품

릴리스

R2022a

태그

질문:

2022년 5월 21일

답변:

2022년 5월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by