Heatmap labels - not working?

5 Ansichten (letzte 30 Tage)
Simon Parten
Simon Parten am 21 Nov. 2018
Bearbeitet: Adam Danz am 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 Kommentar
Adam Danz
Adam Danz am 21 Nov. 2018
Bearbeitet: Adam Danz am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by