Skip to content

Commit

Permalink
add support for linearly spaced isolines
Browse files Browse the repository at this point in the history
  • Loading branch information
dnacombo committed Mar 23, 2023
1 parent 92f7677 commit fcb6113
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plotting/ft_plot_topo3d.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function ft_plot_topo3d(pos, val, varargin)
%
% Optional input arguments should be specified in key-value pairs and can include
% 'contourstyle' = string, 'none', 'black', 'color' (default = 'none')
% 'isolines' = vector with values at which to draw isocontours, or 'auto' (default = 'auto')
% 'isolines' = vector with values at which to draw isocontours, scalar integer of number of linearly spaced isocontours between min and max, or 'auto' (default = 'auto')
% 'facealpha' = scalar, between 0 and 1 (default = 1)
% 'refine' = scalar, number of refinement steps for the triangulation, to get a smoother interpolation (default = 0)
% 'unit' = string, 'm', 'cm' or 'mm' (default = 'cm')
Expand Down Expand Up @@ -124,6 +124,10 @@ function ft_plot_topo3d(pos, val, varargin)
else
ft_error('unsupported isolines');
end
elseif isnumeric(isolines) && numel(isolines) == 1 && floor(isolines) == isolines
minval = min(val);
maxval = max(val);
isolines = linspace(minval,maxval,isolines);
end % convert string to vector

tri_val = val(tri);
Expand Down

0 comments on commit fcb6113

Please sign in to comment.