|
From: | Daniel Arteaga |
Subject: | Re: Legend in scatter plot |
Date: | Fri, 03 Jun 2011 14:30:06 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; ca-ES; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 |
Al 02/06/11 20:37, En/na Ben Abbott ha escrit:
> > Any possible workaround in the meanwhile will be appreciated.Does the script below suit your needs? color = [0; 0.5; 1]; x = [0.15, 1.15, -1.15]; x = mat2cell (x, 1, ones (size (x))); y = [2.15, 0, 1.15]; y = mat2cell (y, 1, ones (size (y))); m = repmat ({"s"}, size (x)); h = plot ([x;y;m]{:}); legend ({"a", "b", "c"}); map = colormap (); for n = 1:numel(h) idx = round (interp1 ([0, 1], [1, size(map,1)], color(n))); set (h(n), "color", map(idx,:)) end Ben
Yes, it does. Thank you very much for your help! I will follow the bug. Daniel
[Prev in Thread] | Current Thread | [Next in Thread] |