33
33
34
34
35
35
% -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);
37
38
38
39
% -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 );
42
41
43
42
% -get heatmap title name-%
44
43
title_name = obj .State .Text(anIndex ).Handle;
45
44
46
45
% -show arrow-%
47
- obj.layout.annotations{anIndex }.showarrow = false ;
46
+ obj.layout.annotations{axIndex }.showarrow = false ;
48
47
49
48
% -------------------------------------------------------------------------%
50
49
51
50
% -anchor title to paper-%
52
51
if obj .State .Text(anIndex ).Title
53
52
% -xref-%
54
- obj.layout.annotations{anIndex }.xref = ' paper' ;
53
+ obj.layout.annotations{axIndex }.xref = ' paper' ;
55
54
% -yref-%
56
- obj.layout.annotations{anIndex }.yref = ' paper' ;
55
+ obj.layout.annotations{axIndex }.yref = ' paper' ;
57
56
else
58
57
% -xref-%
59
- obj.layout.annotations{anIndex }.xref = [' x' num2str(xsource )];
58
+ obj.layout.annotations{axIndex }.xref = [' x' num2str(xsource )];
60
59
% -yref-%
61
- obj.layout.annotations{anIndex }.yref = [' y' num2str(ysource )];
60
+ obj.layout.annotations{axIndex }.yref = [' y' num2str(ysource )];
62
61
end
63
62
64
63
% -------------------------------------------------------------------------%
65
64
66
65
% -xanchor-%
67
- obj.layout.annotations{anIndex }.xanchor = ' middle' ;
66
+ obj.layout.annotations{axIndex }.xanchor = ' middle' ;
68
67
69
68
% -align-%
70
- obj.layout.annotations{anIndex }.align = ' middle' ;
69
+ obj.layout.annotations{axIndex }.align = ' middle' ;
71
70
72
71
% -xanchor-%
73
- obj.layout.annotations{anIndex }.yanchor = ' top' ;
72
+ obj.layout.annotations{axIndex }.yanchor = ' top' ;
74
73
75
74
76
75
% -------------------------------------------------------------------------%
77
76
78
77
% -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 ;
80
80
81
81
% -------------------------------------------------------------------------%
82
82
87
87
eval([' yaxis = obj.layout.yaxis' num2str(ysource ) ' ;' ]);
88
88
89
89
% -x position-%
90
- obj.layout.annotations{anIndex }.x = mean(xaxis .domain );
90
+ obj.layout.annotations{axIndex }.x = mean(xaxis .domain );
91
91
% -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 );
94
93
else
95
94
% -x position-%
96
- obj.layout.annotations{anIndex }.x = text_data .Position(1 );
95
+ obj.layout.annotations{axIndex }.x = text_data .Position(1 );
97
96
% -y position-%
98
- obj.layout.annotations{anIndex }.y = text_data .Position(2 );
97
+ obj.layout.annotations{axIndex }.y = text_data .Position(2 );
99
98
end
100
99
100
+ % -------------------------------------------------------------------------%
101
101
end
0 commit comments