|
69 | 69 |
|
70 | 70 | %---------------------------------------------------------------------%
|
71 | 71 |
|
72 |
| - %-xaxis-% |
73 | 72 | if isHeatmapAxis
|
74 | 73 | xaxis = extractHeatmapAxisData(obj,axisData, 'X');
|
75 | 74 | xExponentFormat = 0;
|
76 | 75 | else
|
77 | 76 | [xaxis, xExponentFormat] = extractAxisData(obj,axisData, 'X');
|
78 | 77 | end
|
79 |
| - |
80 |
| - %---------------------------------------------------------------------% |
81 |
| - |
82 |
| - %-yaxis-% |
83 | 78 | if isHeatmapAxis
|
84 | 79 | yaxis = extractHeatmapAxisData(obj,axisData, 'Y');
|
85 | 80 | yExponentFormat = 0;
|
86 | 81 | else
|
87 | 82 | [yaxis, yExponentFormat] = extractAxisData(obj,axisData, 'Y');
|
88 | 83 | end
|
89 | 84 |
|
90 |
| - %---------------------------------------------------------------------% |
91 |
| - |
92 |
| - %-get position data-% |
93 | 85 | axisPos = axisData.Position .* obj.PlotOptions.DomainFactor;
|
94 | 86 | if obj.PlotOptions.AxisEqual
|
95 | 87 | axisPos(3:4) = min(axisPos(3:4));
|
96 | 88 | end
|
97 | 89 |
|
98 |
| - %---------------------------------------------------------------------% |
99 |
| - |
100 |
| - %-xaxis domain-% |
101 | 90 | xaxis.domain = min([axisPos(1) sum(axisPos([1,3]))], 1);
|
102 | 91 | scene.domain.x = xaxis.domain;
|
103 |
| - |
104 |
| - %---------------------------------------------------------------------% |
105 |
| - |
106 |
| - %-yaxis domain-% |
107 | 92 | yaxis.domain = min([axisPos(2) sum(axisPos([2,4]))], 1);
|
108 | 93 | scene.domain.y = yaxis.domain;
|
109 | 94 |
|
|
122 | 107 | exponentText = sprintf('x10^%d', yExponentFormat);
|
123 | 108 |
|
124 | 109 | obj.layout.annotations{anIndex}.text = exponentText;
|
125 |
| - obj.layout.annotations{anIndex}.xref = ['x' num2str(xsource)]; |
126 |
| - obj.layout.annotations{anIndex}.yref = ['y' num2str(ysource)]; |
| 110 | + obj.layout.annotations{anIndex}.xref = "x" + xsource; |
| 111 | + obj.layout.annotations{anIndex}.yref = "y" + ysource; |
127 | 112 | obj.layout.annotations{anIndex}.xanchor = 'left';
|
128 | 113 | obj.layout.annotations{anIndex}.yanchor = 'bottom';
|
129 | 114 | obj.layout.annotations{anIndex}.font.size = yaxis.tickfont.size;
|
|
142 | 127 | exponentText = sprintf('x10^%d', xExponentFormat);
|
143 | 128 |
|
144 | 129 | obj.layout.annotations{anIndex}.text = exponentText;
|
145 |
| - obj.layout.annotations{anIndex}.xref = ['x' num2str(xsource)]; |
146 |
| - obj.layout.annotations{anIndex}.yref = ['y' num2str(ysource)]; |
| 130 | + obj.layout.annotations{anIndex}.xref = "x" + xsource; |
| 131 | + obj.layout.annotations{anIndex}.yref = "y" + ysource; |
147 | 132 | obj.layout.annotations{anIndex}.xanchor = 'left';
|
148 | 133 | obj.layout.annotations{anIndex}.yanchor = 'bottom';
|
149 | 134 | obj.layout.annotations{anIndex}.font.size = xaxis.tickfont.size;
|
|
159 | 144 |
|
160 | 145 | %---------------------------------------------------------------------%
|
161 | 146 |
|
162 |
| - %-xaxis anchor-% |
163 |
| - xaxis.anchor = ['y' num2str(ysource)]; |
164 |
| - |
165 |
| - %---------------------------------------------------------------------% |
| 147 | + xaxis.anchor = "y" + ysource; |
| 148 | + yaxis.anchor = "x" + xsource; |
166 | 149 |
|
167 |
| - %-yaxis anchor-% |
168 |
| - yaxis.anchor = ['x' num2str(xsource)]; |
169 |
| - |
170 |
| - %---------------------------------------------------------------------% |
171 |
| - |
172 |
| - %-xaxis overlaying-% |
173 | 150 | if xoverlay
|
174 |
| - xaxis.overlaying = ['x' num2str(xoverlay)]; |
| 151 | + xaxis.overlaying = "x" + xoverlay; |
175 | 152 | end
|
176 |
| - |
177 |
| - %---------------------------------------------------------------------% |
178 |
| - |
179 |
| - %-yaxis overlaying-% |
180 | 153 | if yoverlay
|
181 |
| - yaxis.overlaying = ['y' num2str(yoverlay)]; |
| 154 | + yaxis.overlaying = "y" + yoverlay; |
182 | 155 | end
|
183 | 156 |
|
184 | 157 | %---------------------------------------------------------------------%
|
185 | 158 |
|
186 | 159 | % update the layout field (do not overwrite source)
|
187 | 160 | if xsource == axIndex
|
188 |
| - obj.layout = setfield(obj.layout,['xaxis' num2str(xsource)],xaxis); |
189 |
| - obj.layout = setfield(obj.layout,['scene' num2str(xsource)],scene); |
| 161 | + obj.layout = setfield(obj.layout, "xaxis" + xsource, xaxis); |
| 162 | + obj.layout = setfield(obj.layout, "scene" + xsource, scene); |
190 | 163 | end
|
191 | 164 |
|
192 | 165 | %---------------------------------------------------------------------%
|
193 | 166 |
|
194 | 167 | % update the layout field (do not overwrite source)
|
195 | 168 | if ysource == axIndex
|
196 |
| - obj.layout = setfield(obj.layout,['yaxis' num2str(ysource)],yaxis); |
| 169 | + obj.layout = setfield(obj.layout, "yaxis" + ysource, yaxis); |
197 | 170 | end
|
198 | 171 |
|
199 | 172 | %---------------------------------------------------------------------%
|
200 | 173 |
|
201 | 174 | %-REVERT UNITS-%
|
202 |
| - set(obj.State.Axis(axIndex).Handle,'Units',axisUnits); |
| 175 | + set(obj.State.Axis(axIndex).Handle, 'Units', axisUnits); |
203 | 176 |
|
204 | 177 | try
|
205 |
| - set(obj.State.Axis(axIndex).Handle,'FontUnits',fontUnits); |
| 178 | + set(obj.State.Axis(axIndex).Handle, 'FontUnits', fontUnits); |
206 | 179 | catch
|
207 | 180 | % TODO
|
208 | 181 | end
|
|
0 commit comments