开发者

3D plotting in Matlab

I'm using the subplot an开发者_Go百科d then surf functions to generate images in 3D in Matlab. How do I get rid of the axes and axis' gridlines and change the color to all yellow or all green or something like that? Thanks.


Have a look at AXES PROPERTIES. Once you get the handle to the axes using h=gca, you can do `set(h,'propertyName','propertyValue',...) to modify all properties of the axes.

Here's an example (note that you can also modify the properties of the figure, or of the surface - look in the Matlab help for figure properties, for example).

%# create a figure
fh = figure; %# store the figure handle to modify figure properties later
%# plot some data
ph = plot(randn(10,3)); %# this returns three handles, one to each line

%# get the axes handle
ah = gca;

%# hide the axes
set(ah,'Visible','off')
%# show the axes again
set(ah,'Visible','on');
%# change the color to green
set(ah,'Color','g');

%# change the figure color to red (yes, ugly)
set(fh,'Color','r')

%# change the line thickness of the first two lines
set(ph(1:2),'LineWidth',2)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜