Skip to content

Commit 0832b9b

Browse files
Set font size and family once instead of in every cell of a heatmap
1 parent e886486 commit 0832b9b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plotly/plotlyfig_aux/handlegraphics/updateHeatmap.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,19 @@
5858
m = size(cdata, 2);
5959
n = size(cdata, 1);
6060
annotations = cell(1,m*n);
61+
62+
% Set font properties once for all annotations
63+
obj.layout.font = struct( ...
64+
size = heat_data.FontSize*1.15, ...
65+
family = matlab2plotlyfont(heat_data.FontName) ...
66+
);
67+
6168
for i = 1:m
6269
for j = 1:n
6370
ann.text = num2str(round(cdata(j,i), 2));
6471
ann.x = i-1;
6572
ann.y = j-1;
6673
ann.showarrow = false;
67-
ann.font.size = heat_data.FontSize*1.15;
68-
ann.font.family = matlab2plotlyfont(heat_data.FontName);
6974
if cdata(j,i) < 0.925*maxcol
7075
col = [0,0,0];
7176
else

0 commit comments

Comments
 (0)