comparison scripts/plot/print.m @ 10866:045558999570

print.m: Include 'colormap' when converting RGB to mono.
author Ben Abbott <bpabbott@mac.com>
date Sun, 08 Aug 2010 14:49:49 -0400
parents 3a5f5c99cc39
children dd6b90f44ae5
comparison
equal deleted inserted replaced
10865:f065b24f792a 10866:045558999570
290 endif 290 endif
291 set (h, "linestyle", linestyle) 291 set (h, "linestyle", linestyle)
292 endif 292 endif
293 293
294 if (opts.use_color < 0) 294 if (opts.use_color < 0)
295 color_props = {"color", "facecolor", "edgecolor"}; 295 color_props = {"color", "facecolor", "edgecolor", "colormap"};
296 for c = 1:numel(color_props) 296 for c = 1:numel(color_props)
297 h = findobj (opts.figure, "-property", color_props{c}); 297 h = findobj (opts.figure, "-property", color_props{c});
298 hnone = findobj (opts.figure, color_props{c}, "none"); 298 hnone = findobj (opts.figure, color_props{c}, "none");
299 h = setdiff (h, hnone); 299 h = setdiff (h, hnone);
300 m = numel (props); 300 m = numel (props);
302 rgb = get (h(n), color_props{c}); 302 rgb = get (h(n), color_props{c});
303 props(m+n).h = h(n); 303 props(m+n).h = h(n);
304 props(m+n).name = color_props{c}; 304 props(m+n).name = color_props{c};
305 props(m+n).value = {get(h(n), color_props{c})}; 305 props(m+n).value = {get(h(n), color_props{c})};
306 xfer = repmat ([0.30, 0.59, 0.11], size (rgb, 1), 1); 306 xfer = repmat ([0.30, 0.59, 0.11], size (rgb, 1), 1);
307 ## convert RGB color to RGB gray scale 307 if (isnumeric (rgb))
308 ggg = repmat (sum (xfer .* rgb, 2), 1, 3); 308 ## convert RGB color to RGB gray scale
309 set (h(n), color_props{c}, ggg) 309 ggg = repmat (sum (xfer .* rgb, 2), 1, 3);
310 set (h(n), color_props{c}, ggg)
311 endif
310 endfor 312 endfor
311 endfor 313 endfor
312 endif 314 endif
313 315
314 if (! isempty (opts.font) || ! isempty (opts.fontsize)) 316 if (! isempty (opts.font) || ! isempty (opts.fontsize))