comparison scripts/plot/private/__scatter__.m @ 10549:95c3e38098bf

Untabify .m scripts
author Rik <code@nomad.inbox5.com>
date Fri, 23 Apr 2010 11:28:50 -0700
parents 8e58c402ebb2
children 1215ab6f3491
comparison
equal deleted inserted replaced
10548:479536c5bb10 10549:95c3e38098bf
63 63
64 if (istart < nargin && firstnonnumeric > istart + 1) 64 if (istart < nargin && firstnonnumeric > istart + 1)
65 c = varargin{istart + 1}; 65 c = varargin{istart + 1};
66 if (isvector (c)) 66 if (isvector (c))
67 if (columns (c) != 3) 67 if (columns (c) != 3)
68 c = c(:); 68 c = c(:);
69 endif 69 endif
70 endif 70 endif
71 elseif (firstnonnumeric == istart + 1 && ischar (varargin{istart + 1})) 71 elseif (firstnonnumeric == istart + 1 && ischar (varargin{istart + 1}))
72 c = varargin{istart + 1}; 72 c = varargin{istart + 1};
73 firstnonnumeric++; 73 firstnonnumeric++;
85 if (ischar (arg) && strncmpi (arg, "filled", 6)) 85 if (ischar (arg) && strncmpi (arg, "filled", 6))
86 filled = true; 86 filled = true;
87 elseif ((ischar (arg) || iscell (arg)) && ! have_marker) 87 elseif ((ischar (arg) || iscell (arg)) && ! have_marker)
88 [linespec, valid] = __pltopt__ (fcn, arg, false); 88 [linespec, valid] = __pltopt__ (fcn, arg, false);
89 if (valid) 89 if (valid)
90 have_marker = true; 90 have_marker = true;
91 marker = linespec.marker; 91 marker = linespec.marker;
92 if (strncmp (marker, "none", 4)) 92 if (strncmp (marker, "none", 4))
93 marker = "o"; 93 marker = "o";
94 elseif (isempty (marker)) 94 elseif (isempty (marker))
95 [dummy, marker] = __next_line_style__ (); 95 [dummy, marker] = __next_line_style__ ();
96 endif 96 endif
97 else 97 else
98 error ("%s: invalid linespec", fcn); 98 error ("%s: invalid linespec", fcn);
99 endif 99 endif
100 else 100 else
101 newargs{end+1} = arg; 101 newargs{end+1} = arg;
102 if (iarg <= nargin) 102 if (iarg <= nargin)
103 newargs{end+1} = varagin{iarg++}; 103 newargs{end+1} = varagin{iarg++};
104 endif 104 endif
105 endif 105 endif
106 endwhile 106 endwhile
107 107
108 if (isempty (c)) 108 if (isempty (c))
109 c = __next_line_color__(); 109 c = __next_line_color__();
110 endif 110 endif
111 111
112 hg = hggroup (); 112 hg = hggroup ();
113 newargs = __add_datasource__ (fcn, hg, {"x", "y", "z", "c", "size"}, 113 newargs = __add_datasource__ (fcn, hg, {"x", "y", "z", "c", "size"},
114 newargs{:}); 114 newargs{:});
115 115
116 addproperty ("xdata", hg, "data", x); 116 addproperty ("xdata", hg, "data", x);
117 addproperty ("ydata", hg, "data", y); 117 addproperty ("ydata", hg, "data", y);
118 addproperty ("zdata", hg, "data", z); 118 addproperty ("zdata", hg, "data", z);
119 if (ischar (c)) 119 if (ischar (c))
324 ec = get (h, "markeredgecolor"); 324 ec = get (h, "markeredgecolor");
325 kids = get (h, "children"); 325 kids = get (h, "children");
326 326
327 for i = 1 : numel (kids) 327 for i = 1 : numel (kids)
328 set (kids (i), "linewidth", lw, "marker", m, "markerfacecolor", fc, 328 set (kids (i), "linewidth", lw, "marker", m, "markerfacecolor", fc,
329 "edgecolor", ec) 329 "edgecolor", ec)
330 endfor 330 endfor
331 endfunction 331 endfunction
332 332
333 function update_data (h, d) 333 function update_data (h, d)
334 x1 = get (h, "xdata"); 334 x1 = get (h, "xdata");
344 endif 344 endif
345 hlist = get (h, "children"); 345 hlist = get (h, "children");
346 if (ischar (c1)) 346 if (ischar (c1))
347 if (isempty (z1)) 347 if (isempty (z1))
348 for i = 1 : length (hlist) 348 for i = 1 : length (hlist)
349 set (hlist(i), "vertices", [x1(i), y1(i)], "cdata", c1, 349 set (hlist(i), "vertices", [x1(i), y1(i)], "cdata", c1,
350 "markersize", size1(i)); 350 "markersize", size1(i));
351 endfor 351 endfor
352 else 352 else
353 for i = 1 : length (hlist) 353 for i = 1 : length (hlist)
354 set (hlist(i), "vertices", [x1(i), y1(i), z1(i)], "cdata", c1, 354 set (hlist(i), "vertices", [x1(i), y1(i), z1(i)], "cdata", c1,
355 "markersize", size1(i)); 355 "markersize", size1(i));
356 endfor 356 endfor
357 endif 357 endif
358 else 358 else
359 if (isempty (z1)) 359 if (isempty (z1))
360 for i = 1 : length (hlist) 360 for i = 1 : length (hlist)
361 set (hlist(i), "vertices", [x1(i), y1(i)], "cdata", 361 set (hlist(i), "vertices", [x1(i), y1(i)], "cdata",
362 reshape(c1(i,:),[1, size(c1)(2:end)]), "markersize", size1(i)); 362 reshape(c1(i,:),[1, size(c1)(2:end)]), "markersize", size1(i));
363 endfor 363 endfor
364 else 364 else
365 for i = 1 : length (hlist) 365 for i = 1 : length (hlist)
366 set (hlist(i), "vertices", [x1(i), y1(i), z1(i)], "cdata", 366 set (hlist(i), "vertices", [x1(i), y1(i), z1(i)], "cdata",
367 reshape(c1(i,:),[1, size(c1)(2:end)]), "markersize", size1(i)); 367 reshape(c1(i,:),[1, size(c1)(2:end)]), "markersize", size1(i));
368 endfor 368 endfor
369 endif 369 endif
370 endif 370 endif
371 endfunction 371 endfunction