Inverse y-axis heatmap
Ältere Kommentare anzeigen
I would like to make a heatmap from tabular data. My code is below. The heatmap has y-axis values descending order, I would like to them in ascending order. However using set(gca..) gives me the following error:The name 'YDir' is not an accessible property for an instance of class 'matlab.graphics.chart.HeatmapChart'.
In the data below, 's' and 'g' are the independent variable headers in the csv file. 'mean' is the dependent variable header.
data = readtable('data.csv')
h = heatmap(data,'s','g', 'ColorVariable', 'mean');
set(gca,'YDir','normal');
1 Kommentar
Eric Burdette
am 10 Jul. 2019
h = heatmap(data,'s','g', 'ColorVariable', 'mean');
h.YDisplayData = flipud(h.YDisplayData); % equivalent to 'YDir', 'Reverse'
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Distribution Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!