Skip to content
Snippets Groups Projects

Implements #45

Merged Lemmer, Jan requested to merge 45-feature-distance-to-axis into development
1 file
+ 11
5
Compare changes
  • Side-by-side
  • Inline
+ 11
5
@@ -17,6 +17,7 @@ arguments
@@ -17,6 +17,7 @@ arguments
options.Fontsize (1,1) {mustBeInteger} = 8
options.Fontsize (1,1) {mustBeInteger} = 8
options.Color (1,3) {mustBeNonnegative} = 0.65*[1 1 1] % grey
options.Color (1,3) {mustBeNonnegative} = 0.65*[1 1 1] % grey
options.Location (1,:) {mustBeText} = 'east'
options.Location (1,:) {mustBeText} = 'east'
 
options.DistanceToAxis {mustBeReal} = .01 % relative distance
options.Position (1,2) {mustBeVector} = [1,0.4] % default for east
options.Position (1,2) {mustBeVector} = [1,0.4] % default for east
options.Rotation (1,1) {mustBeReal} = NaN
options.Rotation (1,1) {mustBeReal} = NaN
end
end
@@ -41,19 +42,24 @@ end
@@ -41,19 +42,24 @@ end
switch options.Location
switch options.Location
case 'north'
case 'north'
options.Position = [0.4,0.95];
y = 1 - options.DistanceToAxis
 
options.Position = [0.4,y];
Rotation = 0;
Rotation = 0;
case 'east'
case 'east'
options.Position = [1,0.4];
x = 1 - options.DistanceToAxis;
 
options.Position = [x,0.4];
Rotation = 90;
Rotation = 90;
case 'south'
case 'south'
options.Position = [0.4,.02];
y = 0 + options.DistanceToAxis;
 
options.Position = [0.4,y];
Rotation = 0;
Rotation = 0;
case 'west'
case 'west'
options.Position = [.05,0.4];
x = 0 + options.DistanceToAxis;
 
options.Position = [x,0.4];
Rotation = 90;
Rotation = 90;
case 'southeast'
case 'southeast'
options.Position = [0.8,.02];
y = 0 + options.DistanceToAxis;
 
options.Position = [0.8, y];
Rotation = 0;
Rotation = 0;
case 'custom'
case 'custom'
% Check if Position is valid
% Check if Position is valid
Loading