How to change text interpreter of HeatmapChart?

조회 수: 20(최근 30일)
Dominik Mattioli
Dominik Mattioli 2021년 7월 21일
답변: Walter Roberson 2021년 7월 21일
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

채택된 답변

Walter Roberson
Walter Roberson 2021년 7월 21일
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';

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by