接上篇:Matlab精彩画图示例:绘制图上图
这篇介绍两个绘制三维图的命令:
- mesh - 绘制三维网状图
- surf - 绘制三维曲面图
matlab代码如下:
程序运行结果如下:
mesh(X,Y,Z) draws a wireframe mesh with color determined by Z, so color is proportional to surface height.
surf(X,Y,Z) creates a three-dimensional surface plot. The function plots the values in matrix Z as heights above a grid in the x-y plane defined by X and Y. The function also uses Z for the color data, so color is proportional to height.
colorbar是色彩条状图的命令,默认显示在图形的右侧。
colorbar displays a vertical colorbar to the right of the current axes or chart. Colorbars display the current colormap and indicate the mapping of data values into the colormap.
扩展阅读
Matlab学习总结:从入门到离不开