Mercurial > hg > octave-lyh
comparison scripts/plot/private/__go_draw_axes__.m @ 14108:5be545210fe3 stable
Trisurf() improvements.
* __go_draw_axes__.m: Revert changeset 595ee644fa6f.
Properly identify RGB cdata [1x3] for patches.
* trisurf.m: Correct bugs in converting between facevertexcdata and cdata.
This allows caxis auto to function correctly, and properly fixes bug 35144.
Add demos to explicitly test facecolor = "flat" and "interp".
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sun, 25 Dec 2011 12:18:49 -0500 |
parents | 595ee644fa6f |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
14107:3eee907d79c7 | 14108:5be545210fe3 |
---|---|
692 elseif (ndims (obj.cdata) == 3) | 692 elseif (ndims (obj.cdata) == 3) |
693 ccol = permute (cdat (:, i, :), [1, 3, 2]); | 693 ccol = permute (cdat (:, i, :), [1, 3, 2]); |
694 else | 694 else |
695 ccol = cdat; | 695 ccol = cdat; |
696 endif | 696 endif |
697 if (strncmp (obj.facecolor, "interp", 6) && nd == 3 | |
698 && numel (xcol) == 3 && isempty (ccol)) | |
699 ## FIXME - Use isonormals to render interpolated | |
700 ## triangular patches. | |
701 obj.facecolor = "flat"; | |
702 endif | |
703 if (strncmp (obj.facecolor, "flat", 4)) | 697 if (strncmp (obj.facecolor, "flat", 4)) |
704 if (numel (ccol) == 3) | 698 if (isequal (size (ccol), [1, 3])) |
699 ## RGB Triplet | |
705 color = ccol; | 700 color = ccol; |
706 elseif (nd == 3 && numel (xcol) == 3) | 701 elseif (nd == 3 && numel (xcol) == 3) |
707 if (isempty (ccol)) | 702 ccdat = ccol; |
708 z = mean (zcol); | |
709 nr = size (cmap, 1); | |
710 r = interp1 (linspace (clim(1), clim(2), nr), | |
711 (1:nr), z, "nearest", "extrap"); | |
712 color = cmap (r, :); | |
713 else | |
714 ccdat = ccol * ones (3,1); | |
715 endif | |
716 else | 703 else |
717 if (cdatadirect) | 704 if (cdatadirect) |
718 r = round (ccol); | 705 r = round (ccol); |
719 else | 706 else |
720 r = 1 + round ((size (cmap, 1) - 1) | 707 r = 1 + round ((size (cmap, 1) - 1) |