File tree Expand file tree Collapse file tree 1 file changed +21
-15
lines changed
plotly/plotlyfig_aux/helpers Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Original file line number Diff line number Diff line change 1
1
function [overlapping , overlapaxes ] = isOverlappingAxis(obj , axIndex )
2
+ % -STANDARDIZE UNITS-%
3
+ axis_units = cell(1 ,axIndex );
4
+ for a = 1 : axIndex
5
+ axis_units{a } = obj .State .Axis(a ).Handle.Units;
6
+ obj .State .Axis(a ).Handle.Units = " normalized" ;
7
+ end
2
8
3
- % -STANDARDIZE UNITS-%
4
- axis_units = cell(1 ,axIndex );
5
- for a = 1 : axIndex
6
- axis_units{a } = obj .State .Axis(a ).Handle.Units;
7
- set(obj .State .Axis(a ).Handle,' Units' ,' normalized' );
8
- end
9
-
10
- % check axis overlap
11
- overlapaxes = find(arrayfun(@(x )(isequal(x .Handle .Position ,obj .State .Axis(axIndex ).Handle.Position)),obj .State .Axis(1 : axIndex )));
12
- overlapping = length(overlapaxes ) > 1 ; % greater than 1 because obj.State.Axis(axIndex) will always be an overlapping axis
13
-
14
- % -REVERT UNITS-%
15
- for a = 1 : axIndex
16
- set(obj .State .Axis(a ).Handle,' Units' ,axis_units{a });
17
- end
9
+ % check axis overlap
10
+ if axIndex == 1 % redundant to check this case
11
+ overlapaxes = 1 ;
12
+ else
13
+ overlapaxes = find(arrayfun(@(x ) isequal(x .Handle .Position , ...
14
+ obj .State .Axis(axIndex ).Handle.Position), ...
15
+ obj .State .Axis(1 : axIndex )));
16
+ end
17
+ % greater than 1 because obj.State.Axis(axIndex) will always be an
18
+ % overlapping axis
19
+ overlapping = length(overlapaxes ) > 1 ;
18
20
21
+ % -REVERT UNITS-%
22
+ for a = 1 : axIndex
23
+ obj .State .Axis(a ).Handle.Units = axis_units{a };
24
+ end
19
25
end
You can’t perform that action at this time.
0 commit comments