简体   繁体   English

Matlab中的3D绘图

[英]3D plotting in Matlab

I'm using the subplot and then surf functions to generate images in 3D in Matlab. 我正在使用子图,然后使用冲浪功能在Matlab中以3D形式生成图像。 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 . 看看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. 一旦使用h=gca获得轴的句柄,就可以执行set(h,'propertyName','propertyValue',...)来修改轴的所有属性。

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). 这是一个示例(请注意,您也可以修改图形或曲面的figure properties例如,在Matlab帮助中查看figure properties )。

%# 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM