The HeatmapChart() object takes over control of the XLabel, YLabel, Title, and TickLabels seemingly without letting you change the text interpreter. Is there an undocumented workaround or am I missing something?
figure;
h = heatmap([1 3 5; 2 4 6]);
h.Title = 'My Heatmap Title';
set( findall( gca,'-property','Interpreter' ),'Interpreter', 'Latex' ) % doesn't help
set( findall( gcf,'-property','Interpreter' ),'Interpreter', 'Latex' ) % doesn't help
set( groot, 'defaultAxesTickLabelInterpreter', 'LaTeX' ) % doesn't help

 採用された回答

Benjamin Kraus
Benjamin Kraus 2023 年 9 月 20 日

1 投票

Starting in MATLAB R2023b, the HeatmapChart now has an Interpreter property.
h = heatmap([1 3 5; 2 4 6]);
h.Title = '$x^y$';
h.Interpreter = 'latex';

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 7 月 21 日

2 投票

h = heatmap([1 3 5; 2 4 6]);
h.Title = '$x^y$';
h.NodeChildren(3).XAxis.TickLabelInterpreter = 'latex';
h.NodeChildren(3).YAxis.TickLabelInterpreter = 'latex';
h.NodeChildren(3).Title.Interpreter = 'latex';

2 件のコメント

Ryszard Puc
Ryszard Puc 2022 年 8 月 17 日
Is there any way to change the numbers inside to LaTeX?
Walter Roberson
Walter Roberson 2022 年 8 月 18 日
No, there does not appear to be any way to do that. Some of the details are hidden inside a .p so I cannot be absolutely certain, but all of the code I have found so far requires that the data be numeric.

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

カテゴリ

ヘルプ センター および File Exchange で Data Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by