Heatmap labels - not working?

4 ビュー (過去 30 日間)
Simon Parten
Simon Parten 2018 年 11 月 21 日
編集済み: Adam Danz 2018 年 11 月 21 日
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 件のコメント
Adam Danz
Adam Danz 2018 年 11 月 21 日
編集済み: Adam Danz 2018 年 11 月 21 日
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by