How to create heatmap chart
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Isyraf
il 16 Ago 2022
Modificato: Cris LaPierre
il 16 Ago 2022
I have dataset of matrix 45x9 with variables 'station' and the other 8 are heavy metals concentration. I want to plot a heatmap to show which station have the highest and lowest concentration, instead in values. The 'station' will be y and the heavy metals concentration will be x. A coding of a heatmap chart of station and one of the the heavy metals concentration would be suffice, but if possible i would like the coding for heatmap chart of station and all the heavy metals.
Risposta accettata
Cris LaPierre
il 16 Ago 2022
Modificato: Cris LaPierre
il 16 Ago 2022
I would use the following syntax:
You haven't shared your station names, so this approach uses the values in the table (loaded as strings).
fileNm = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1099640/HMCSV.csv';
opts = detectImportOptions(fileNm);
opts = setvartype(opts,'Station','string');
data = readtable(fileNm,opts)
% Create heatmap
heatmap(data.Properties.VariableNames(2:end),data.Station,data{:,2:end})
% Default color is shades of blue. This changes it to blue->black
colormap jet
The values will appear if you make the figure bigger (maximize it on your computer).
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Distribution Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!