1
## Copyright (C) 2007 David Bateman
3
## This file is part of Octave.
5
## Octave is free software; you can redistribute it and/or modify it
6
## under the terms of the GNU General Public License as published by
7
## the Free Software Foundation; either version 3 of the License, or (at
8
## your option) any later version.
10
## Octave is distributed in the hope that it will be useful, but
11
## WITHOUT ANY WARRANTY; without even the implied warranty of
12
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
## General Public License for more details.
15
## You should have received a copy of the GNU General Public License
16
## along with Octave; see the file COPYING. If not, see
17
## <http://www.gnu.org/licenses/>.
19
## Undocumented internal function.
21
function h = __scatter__ (varargin)
34
z = zeros (length (x), 0);
37
firstnonnumeric = Inf;
39
if (! isnumeric (varargin{i}))
45
if (istart < nargin && firstnonnumeric > istart)
53
## Note markersize is in points^2 for 2D and points for 3D, and
54
## the below is an approximation, that is empircally visually correct.
61
if (istart < nargin && firstnonnumeric > istart + 1)
62
c = varargin{istart + 1};
66
elseif (firstnonnumeric == istart + 1 && ischar (varargin{istart + 1}))
67
c = varargin{istart + 1};
77
iarg = firstnonnumeric;
78
while (iarg <= nargin)
79
arg = varargin{iarg++};
80
if (ischar (arg) && strncmp (tolower (arg), "filled", 6))
82
elseif ((isstr (arg) || iscell (arg)) && ! have_marker)
83
[linespec, valid] = __pltopt__ ("scatter", arg, false);
86
marker = linespec.marker;
87
if (strncmp (marker, "none", 4))
91
error ("scatter: invalid linespec");
96
newargs{end+1} = varagin{iarg++};
102
h = patch("faces", [1:length(x)].', "vertices", [x, y, z], "facecolor",
103
"none", "edgecolor", c, "marker", marker,
104
"markersize", s, "linestyle", "none");
106
set(h, "markerfacecolor", c);
109
h = patch("faces", [1:length(x)].', "vertices", [x, y, z], "facecolor",
110
"none", "edgecolor", "flat", "cdata", c, "marker", marker,
111
"markersize", s, "linestyle", "none");
113
set(h, "markerfacecolor", "flat");
115
ax = get (h, "parent");
116
clim = get (ax, "clim");
117
if (min(c(:)) < clim(1))
119
set (ax, "clim", clim);
121
if (max(c(:)) > clim(2))
122
set (ax, "clim", [clim(1), max(c(:))]);