3333
3434
3535% -AXIS INDEX-%
36- axIndex = obj .getAxisIndex(obj .State .Text(anIndex ).AssociatedAxis);
36+ nanns = length(obj .layout .annotations );
37+ axIndex = nanns + obj .getAxisIndex(obj .State .Text(anIndex ).AssociatedAxis);
3738
3839% -CHECK FOR MULTIPLE AXES-%
39- [xsource , ysource ] = findSourceAxis(obj ,axIndex );
40- eval([' xaxis = obj.layout.xaxis' num2str(xsource ) ' ;' ]);
41- eval([' yaxis = obj.layout.yaxis' num2str(ysource ) ' ;' ]);
40+ [xsource , ysource ] = findSourceAxis(obj ,anIndex );
4241
4342% -get heatmap title name-%
4443title_name = obj .State .Text(anIndex ).Handle;
4544
4645% -show arrow-%
47- obj.layout.annotations{anIndex }.showarrow = false ;
46+ obj.layout.annotations{axIndex }.showarrow = false ;
4847
4948% -------------------------------------------------------------------------%
5049
5150% -anchor title to paper-%
5251if obj .State .Text(anIndex ).Title
5352 % -xref-%
54- obj.layout.annotations{anIndex }.xref = ' paper' ;
53+ obj.layout.annotations{axIndex }.xref = ' paper' ;
5554 % -yref-%
56- obj.layout.annotations{anIndex }.yref = ' paper' ;
55+ obj.layout.annotations{axIndex }.yref = ' paper' ;
5756else
5857 % -xref-%
59- obj.layout.annotations{anIndex }.xref = [' x' num2str(xsource )];
58+ obj.layout.annotations{axIndex }.xref = [' x' num2str(xsource )];
6059 % -yref-%
61- obj.layout.annotations{anIndex }.yref = [' y' num2str(ysource )];
60+ obj.layout.annotations{axIndex }.yref = [' y' num2str(ysource )];
6261end
6362
6463% -------------------------------------------------------------------------%
6564
6665% -xanchor-%
67- obj.layout.annotations{anIndex }.xanchor = ' middle' ;
66+ obj.layout.annotations{axIndex }.xanchor = ' middle' ;
6867
6968% -align-%
70- obj.layout.annotations{anIndex }.align = ' middle' ;
69+ obj.layout.annotations{axIndex }.align = ' middle' ;
7170
7271% -xanchor-%
73- obj.layout.annotations{anIndex }.yanchor = ' top' ;
72+ obj.layout.annotations{axIndex }.yanchor = ' top' ;
7473
7574
7675% -------------------------------------------------------------------------%
7776
7877% -text-%
79- obj.layout.annotations{anIndex }.text = title_name ;
78+ obj.layout.annotations{axIndex }.text = sprintf(' <b>%s </b>' , title_name );
79+ obj.layout.annotations{axIndex }.font.size = 14 ;
8080
8181% -------------------------------------------------------------------------%
8282
8787 eval([' yaxis = obj.layout.yaxis' num2str(ysource ) ' ;' ]);
8888
8989 % -x position-%
90- obj.layout.annotations{anIndex }.x = mean(xaxis .domain );
90+ obj.layout.annotations{axIndex }.x = mean(xaxis .domain );
9191 % -y position-%
92- % obj.layout.annotations{anIndex}.y = (yaxis.domain(2) + obj.PlotlyDefaults.TitleHeight);
93- obj.layout.annotations{anIndex }.y = (yaxis .domain(2 ) + 0.04 );
92+ obj.layout.annotations{axIndex }.y = (yaxis .domain(2 ) + 0.04 );
9493else
9594 % -x position-%
96- obj.layout.annotations{anIndex }.x = text_data .Position(1 );
95+ obj.layout.annotations{axIndex }.x = text_data .Position(1 );
9796 % -y position-%
98- obj.layout.annotations{anIndex }.y = text_data .Position(2 );
97+ obj.layout.annotations{axIndex }.y = text_data .Position(2 );
9998end
10099
100+ % -------------------------------------------------------------------------%
101101end
0 commit comments