Mercurial > hg > octave-lojdl
changeset 9118:308311b642b2
Explicitly set the default facecolor of patches
author | David Bateman <dbateman@free.fr> |
---|---|
date | Tue, 14 Apr 2009 21:22:24 +0200 |
parents | efac34f78ea4 |
children | 3b810beddfa6 |
files | scripts/ChangeLog scripts/plot/__patch__.m |
diffstat | 2 files changed, 26 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-04-11 David Bateman <dbateman@free.fr> + + * plot/__patch__.m: Set default facecolor to [0,1,0]. + 2009-04-12 Aravindh Krishnamoorthy <aravindh.k.dev@gmail.com> * special-matrix/hadamard.m: Fix a documentation mistake.
--- a/scripts/plot/__patch__.m +++ b/scripts/plot/__patch__.m @@ -177,18 +177,23 @@ else vert = args {idx}; endif - idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args)) + 1; - if (isempty(idx) || idx > nargs) - fc = "flat"; - else - fc = args {idx}; - endif idx = find (cellfun (@(x) strcmpi (x, "facevertexcdata"), args)) + 1; if (isempty(idx) || idx > nargs) fvc = []; else fvc = args {idx}; endif + idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args)) + 1; + if (isempty(idx) || idx > nargs) + if (!isempty (fvc)) + fc = "flat"; + else + fc = [0, 1, 0]; + endif + args = {"facecolor", fc, args{:}}; + else + fc = args {idx}; + endif nr = size (faces, 2); nc = size (faces, 1); @@ -247,18 +252,23 @@ else z = args {idx}; endif - idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args)) + 1; - if (isempty(idx) || idx > nargs) - fc = "flat"; - else - fc = args {idx}; - endif idx = find (cellfun (@(x) strcmpi (x, "cdata"), args)) + 1; if (isempty(idx) || idx > nargs) c = []; else c = args {idx}; endif + idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args)) + 1; + if (isempty(idx) || idx > nargs) + if (!isempty (c)) + fc = "flat"; + else + fc = [0, 1, 0]; + endif + args = {"facecolor", fc, args{:}}; + else + fc = args {idx}; + endif [nr, nc] = size (x); if (!isempty (z))