|
43 | 43 |
|
44 | 44 | %-STANDARDIZE UNITS-% |
45 | 45 | colorbarUnits = colorbarData.Units; |
46 | | - set(obj.State.Colorbar(colorbarIndex).Handle, 'Units', 'normalized'); |
| 46 | + obj.State.Colorbar(colorbarIndex).Handle.Units = 'normalized'; |
47 | 47 |
|
48 | 48 | %---------------------------------------------------------------------% |
49 | 49 |
|
|
120 | 120 | titlefontunits = colorbarTitleData.FontUnits; |
121 | 121 | ylabelunits = colorbarYLabelData.Units; |
122 | 122 | ylabelfontunits = colorbarYLabelData.FontUnits; |
123 | | - set(colorbarTitle,'Units', 'data'); |
124 | | - set(colorbarYLabel,'Units', 'data'); |
125 | | - set(colorbarYLabel,'FontUnits', 'points'); |
| 123 | + colorbarTitle.Units = 'data'; |
| 124 | + colorbarYLabel.Units = 'data'; |
| 125 | + colorbarYLabel.FontUnits = 'points'; |
126 | 126 | if ~isHG2 |
127 | 127 | xlabelunits = colorbarXLabelData.Units; |
128 | 128 | xlabelfontunits = colorbarXLabelData.FontUnits; |
129 | | - set(colorbarTitle,'FontUnits', 'points'); |
130 | | - set(colorbarXLabel,'Units', 'data'); |
131 | | - set(colorbarXLabel,'FontUnits', 'points'); |
| 129 | + colorbarTitle.FontUnits = 'points'; |
| 130 | + colorbarXLabel.Units = 'data'; |
| 131 | + colorbarXLabel.FontUnits = 'points'; |
132 | 132 | end |
133 | 133 |
|
134 | 134 | %---------------------------------------------------------------------% |
|
150 | 150 | titleFontColor = sprintf("rgb(%d,%d,%d)", ... |
151 | 151 | round(255*colorbarTitleData.Color)); |
152 | 152 | titleFontFamily = matlab2plotlyfont(colorbarTitleData.FontName); |
153 | | - |
154 | 153 | elseif ~isempty(colorbarXLabelData.String) |
155 | 154 | titleString = colorbarXLabelData.String; |
156 | 155 | titleInterpreter = colorbarXLabelData.Interpreter; |
|
160 | 159 | titleFontColor = sprintf("rgb(%d,%d,%d)", ... |
161 | 160 | round(255*colorbarXLabelData.Color)); |
162 | 161 | titleFontFamily = matlab2plotlyfont(colorbarXLabelData.FontName); |
163 | | - |
164 | 162 | elseif ~isempty(colorbarYLabelData.String) |
165 | 163 | titleString = colorbarYLabelData.String; |
166 | 164 | titleInterpreter = colorbarYLabelData.Interpreter; |
|
170 | 168 | titleFontColor = sprintf("rgb(%d,%d,%d)", ... |
171 | 169 | round(255*colorbarYLabelData.Color)); |
172 | 170 | titleFontFamily = matlab2plotlyfont(colorbarYLabelData.FontName); |
173 | | - |
174 | 171 | else |
175 | 172 | isTitle = false; |
176 | 173 | end |
|
186 | 183 | %---------------------------------------------------------------------% |
187 | 184 |
|
188 | 185 | %-REVERT UNITS FOR TITLE-% |
189 | | - set(colorbarTitle,'Units', titleunits); |
190 | | - set(colorbarTitle,'FontUnits', titlefontunits); |
191 | | - set(colorbarYLabel,'Units', ylabelunits); |
192 | | - set(colorbarYLabel,'FontUnits', ylabelfontunits); |
| 186 | + colorbarTitle.Units = titleunits; |
| 187 | + colorbarTitle.FontUnits = titlefontunits; |
| 188 | + colorbarYLabel.Units = ylabelunits; |
| 189 | + colorbarYLabel.FontUnits = ylabelfontunits; |
193 | 190 |
|
194 | 191 | if ~isHG2 |
195 | | - set(colorbarXLabel,'Units', xlabelunits); |
196 | | - set(colorbarXLabel,'FontUnits', xlabelfontunits); |
| 192 | + colorbarXLabel.Units = xlabelunits; |
| 193 | + colorbarXLabel.FontUnits = xlabelfontunits; |
197 | 194 | end |
198 | 195 |
|
199 | 196 | %---------------------------------------------------------------------% |
|
207 | 204 | if isempty(tickValues) |
208 | 205 | showTickLabels = false; |
209 | 206 | colorbar.ticks = ''; |
210 | | - |
211 | 207 | elseif isempty(tickLabels) |
212 | 208 | colorbar.tickvals = tickValues; |
213 | | - |
214 | 209 | else |
215 | 210 | colorbar.tickvals = tickValues; |
216 | 211 | colorbar.ticktext = tickLabels; |
|
232 | 227 | case 'out' |
233 | 228 | colorbar.ticks = 'outside'; |
234 | 229 | end |
235 | | - |
236 | 230 | end |
237 | | - |
238 | 231 | else |
239 | 232 | colorbar = setTicksNotHG2(colorbar, colorbarData); |
240 | 233 | end |
|
268 | 261 | %---------------------------------------------------------------------% |
269 | 262 |
|
270 | 263 | %-REVERT UNITS-% |
271 | | - set(obj.State.Colorbar(colorbarIndex).Handle, 'Units', colorbarUnits); |
| 264 | + obj.State.Colorbar(colorbarIndex).Handle.Units = colorbarUnits; |
272 | 265 | end |
273 | 266 |
|
274 | 267 | function colorbar = setTicksNotHG2(colorbar, colorbarData) |
|
288 | 281 | colorbar.ticks = 'outside'; |
289 | 282 | end |
290 | 283 |
|
291 | | - if strcmp(colorbarData.YTickLabelMode,'auto') |
| 284 | + if strcmp(colorbarData.YTickLabelMode, 'auto') |
292 | 285 | %-autotick-% |
293 | 286 | colorbar.autotick = true; |
294 | 287 | %-numticks-% |
|
325 | 318 | colorbar.ticks = 'outside'; |
326 | 319 | end |
327 | 320 |
|
328 | | - if strcmp(colorbarData.XTickLabelMode,'auto') |
| 321 | + if strcmp(colorbarData.XTickLabelMode, 'auto') |
329 | 322 | %-autotick-% |
330 | 323 | colorbar.autotick = true; |
331 | 324 | %-numticks-% |
|
0 commit comments