Azzera filtri
Azzera filtri

How to sort heatmap columns based on outside data

4 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Voss
Voss il 21 Mag 2022
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));

Più risposte (0)

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by