Skip to content

Commit

Permalink
geom2d: fix display of points with single argument for drawing style
Browse files Browse the repository at this point in the history
  • Loading branch information
dlegland committed Jun 7, 2018
1 parent 5e733e1 commit 4ef3f11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions matGeom/geom2d/drawPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@
error ('Points should be two 1D arrays or one N-by-2 array');
end

if ~isempty (varargin)
if length(varargin) > 1
% Check if linestyle is given
char_opt = cellfun (@tolower, varargin(cellfun (@ischar, varargin)), ...
char_opt = cellfun (@lower, varargin(cellfun (@ischar, varargin)), ...
'UniformOutput', false);
tf = ismember ('linestyle', char_opt);
if tf
error ('Points cannot be draw with lines, use plot or drawPolygon instead');
end
h = plot (ax, px, py, 'marker', 'o', 'linestyle', 'none', varargin{:});

elseif length(varargin) == 1
% use the specified single option (for example: 'b.', or 'k+')
h = plot (ax, px, py, varargin{1});
else
% use a default marker
h = plot (ax, px, py, 'o');
end

0 comments on commit 4ef3f11

Please sign in to comment.