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

1 回表示 (過去 30 日間)
mathworks2011
mathworks2011 2011 年 10 月 19 日
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

採用された回答

Kwok Chong
Kwok Chong 2011 年 10 月 25 日
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!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeJust for fun についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by