Effacer les filtres
Effacer les filtres

Heatmap labels - not working?

5 vues (au cours des 30 derniers jours)
Simon Parten
Simon Parten le 21 Nov 2018
Modifié(e) : Adam Danz le 21 Nov 2018
mytable = table([1e6, 2e6, 3e6, 1.5e6, 2.5e6, 3.5e6]', ["v1", "v1","v1", "v2","v2","v2" ]', ["met1", "met2", "met3","met1", "met2", "met3"]', 'VariableNames', {'val', 'ver', 'metric'} );
heatmap(mytable,'ver','metric', 'ColorVariable','val','CellLabelFormat', '%.g')
heatmap(mytable,'ver','metric', 'ColorVariable','val','CellLabelFormat', '%,g')
First heatmap work... second doesn't produce labels. Can anyone tell me why?
Warning: Error updating HeatmapChart.
'ColorData' value must be a 4-row, uint8 matrix with the same number of columns as the length of the 'Strings' value.
Noie that according to the documentation for heatmap, the second line should produce a comma separated number in the boxes.
  1 commentaire
Adam Danz
Adam Danz le 21 Nov 2018
Modifié(e) : Adam Danz le 21 Nov 2018
Looks like you found a bug. The comma option in
'CellLabelFormat', '%,g'
is not available in sprintf() or fprintf() and it doesn't function in heatmap(). Maybe it's a sign of features to come (which has been requested a lot in the forum).
Even when you try to change the formatting after plotting, you get an error.
h = heatmap(...)
h.CellLabelFormat = '%,4.4g'
Warning: Error updating HeatmapChart.
Invalid format.
The bug has been reported.
In the mean time, you could use %.f if you want to get rid of exponential notation.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by