How to change the codes to adapt to the change of graphic handle changes in r2014b?
1 view (last 30 days)
Show older comments
The following codes work well in r2014a. But it does not work in r2014b because the graphic handle has been changed. So would there be a quick way to change the codes? Any help would be highly appreciated.
[c,h]=contour3(peaks(30));
for i=1:length(h)
zz=get(h(i),'Zdata');
set(h(i), 'ZData', 0* ones(size(zz)));
end
view(3);
0 Comments
Accepted Answer
Walter Roberson
on 26 Sep 2015
The replacement code for that is
contour(peaks(30));
view(3);
grid on
In the few releases before R2014b, contour() created a contourgroup and contour3() created patch objects (in older releases yet contour() produced patch as well). However, as long as you are not needing to distinguish between contour3() and contour() on the basis that the pre-R2014b contour3() cannot have filled contours turned on easily the way contour() can, or otherwise needing to mangle the patch properties, then contour() is effectively the same as contour3() except that contour() already has the z set at 0.
If you had happened to want to set the z to something other than 0, then I have no idea how to implement that from R2014b onward.
7 Comments
Walter Roberson
on 27 Dec 2015
Refer back to the approach Mike Garrity showed above using hgtransform.
More Answers (0)
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!