fnplt, splines and figure properties - problems with inbuilt MATHWORKS function

4 Ansichten (letzte 30 Tage)
I have some 3D data and I plot into a B-spline:
Z2 = repmat(z, [1, size(z,1)]);
tol = 0.1E-5;
sp = spaps({x,y},Z2,tol);
fnplt(sp);
(where x, y, z are (1xK) vectors.
I now wish to alter the image of my 3D surface.
for a normal plot eg
h = surf(x,y,Z2);
I would type:
set(h, 'EdgeColor','none');
set(h, 'FaceColor','interp');
set(h, 'FaceLighting','phong');
Where h is a handle. However, I cant generate a handle from fnplt.
I also see that get(gca) and get(gcf) do not allow me access to the properities I wish to set.
I can do what I want, via opening up the visual editor and doing it manually. (the auto code generator for this doesnt seem to give meaningful answers).
Am sure I have missed something obvious.
Many thanks

Akzeptierte Antwort

Kwok Chong
Kwok Chong am 25 Okt. 2011
Scanning through the code of fnplt.m, I can see that fnplt does not output the handle to the surface object it plots. However, it is just a normal, everyday surface object, plotted with the surf command.
So there are two ways to change the properties:
1- Grab the "points" output argument from fnplt, then plot it with surf. E.g.:
points = fnplt(sp);
h = surf(points{1},points{2},points{3});
2- Grab the handle using some handle locating function like findall. E.g.:
h = findall(gca,'type','surface');
Hope that helps!

Weitere Antworten (0)

Kategorien

Mehr zu Just for fun finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by