MATLAB如何对空间图形进行装饰

 时间:2024-10-13 05:52:35

1、设置背景颜色 colordef white%将图形背景设置为白色colordef black%将图形背景设置为黑色colordef none%不设置图形背景颜色如:>> x=linspace(-pi,pi,40);y=linspace(-pi,pi,40);[X,Y]=meshgrid(x,y);Z=X.^2+Y.^2;surf(X,Y,Z)colordef white

MATLAB如何对空间图形进行装饰MATLAB如何对空间图形进行装饰

2、设置图形的颜色colormap(cm)%根据色图矩阵cm设置图形的颜色如:>> x=linspace(-pi,pi,40);y=linspace(-pi,pi,40);[X,Y]=meshgrid(x,y);Z=X.^2+Y.^2;surf(X,Y,Z)colormap([0 1 0])>> title('green')

MATLAB如何对空间图形进行装饰MATLAB如何对空间图形进行装饰

3、添加颜色标尺colorbar('location','value')%根据location的值value添加颜色标尺其中location可以取north(坐标框上方'),south(下方'),east(东方),west(西方)如:>> x=linspace(-pi,pi,40);y=linspace(-pi,pi,40);[X,Y]=meshgrid(x,y);Z=X.^2+Y.^2;surf(X,Y,Z)>> colorbar('location','south')

MATLAB如何对空间图形进行装饰MATLAB如何对空间图形进行装饰

4、设置着色方式stading flat%平滑方式着色shading interp%插值方式着色shading faceted鬈熵痼霄%以平面为单位着色如:>> x=linspace(-pi,pi,40);y=linspace(-pi,pi,40);[X,Y]=meshgrid(x,y);Z=X.^2+Y.^2;surf(X,Y,Z)>> shading flat>> title('shading flat')>> figure(2)>> surf(X,Y,Z);>> shading interp>> title('shading interp')

MATLAB如何对空间图形进行装饰MATLAB如何对空间图形进行装饰

5、设置照明属性light%为当前坐标系设置默认的照明属性如:>> x=linspace(-pi,pi,40);y=linspace(-pi,pi,40);[X,Y]=meshgrid(x,y);Z=X.^2+Y.^2;surf(X,Y,Z)light('color','r')

MATLAB如何对空间图形进行装饰

6、设置照明模式lighting 酆璁冻嘌flat%平面模式,系统默认模式lighting gouraud%点模式lighting phong%对定点处法线插值,再计算像素的反光lighting none%关闭所有光源如:>> x=linspace(-pi,pi,40);y=linspace(-pi,pi,40);[X,Y]=meshgrid(x,y);Z=X.^2+Y.^2;surf(X,Y,Z)lightlighting phongtitle('lighting phong')figure(2)surf(X,Y,Z)light>> lighting none>> title('lighting none')

MATLAB如何对空间图形进行装饰MATLAB如何对空间图形进行装饰
  • MATLAB安装教程解析
  • 如何在matlab中使用字符与文本?
  • 如何用c语言解决卷积法处理图像
  • Mathematica--Part函数的用法
  • 如何用MATLAB编写有关微积分的计算
  • 热门搜索
    为什么要 萝卜咸菜的做法 怎么画 鲍鱼怎么做好吃 孕妇感冒了怎么办 电脑风扇声音大怎么办 粉条怎么做好吃 花呗怎么还款 荷花怎么画 煤气灶打不着火怎么办