Borrar filtros
Borrar filtros

Heatmap labels - not working?

5 visualizaciones (últimos 30 días)
Simon Parten
Simon Parten el 21 de Nov. de 2018
Editada: Adam Danz el 21 de Nov. de 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 comentario
Adam Danz
Adam Danz el 21 de Nov. de 2018
Editada: Adam Danz el 21 de Nov. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by