首页 > 其他 > 详细

MATLAB三维绘图(四)绘制特殊的三维图

时间:2020-03-09 13:23:39      阅读:92      评论:0      收藏:0      [点我收藏+]

MATLAB三维绘图(四)绘制特殊的三维图

1、使用pie3绘制三维饼状图,示例:

%% 绘制三维饼图
clear all;
x=[0.2 0.1 0.25 0.15 0.16];
y=[3 5.5 7 10.5 8.5];
figure;
subplot(121);
pie3(x)                 %绘制三维饼图
subplot(122);
explode=[0 0 0 1 0];
pie3(y,explode);            %绘制三维饼图

效果显示:
技术分享图片
2、使用scatter3函数绘制散点图,示例:

%% 绘制三维散点图
clear; clc; close all;
x=rand(1,20);
y=rand(1,20);
z=x+y;
figure;
subplot(121);
scatter3(x,y,z)             %绘制三维散点图
title('空心点');
subplot(122);
scatter3(x,y,z,'r','filled');       %绘制三维散点图
title('实心点');

效果显示:
技术分享图片
3、使用stem3函数绘制三维杆状图,示例:

%%  绘制三维火柴杆图
clear; clc; close all;
x=rand(1,20);
y=rand(1,20);
z=x+y;
figure;
subplot(121);
stem3(x,y,z)            %绘制三维火柴杆图
title('空心杆');
subplot(122);
stem3(x,y,z,'r','filled');  %绘制三维火柴杆图
title('实心杆');

效果显示:
技术分享图片
4、使用comet3函数绘制三维彗星动态图,示例:

%% 绘制三维彗星图
clear; clc; close all;
t=-pi:pi/400:pi;
x=sin(5*t);
y=cos(3*t);
z=t;
figure(15);
comet3(x,y,z);      %绘制三维彗星图

效果显示:
技术分享图片
说明:还有很多这样特殊的三维图,读者可以根据自身的需要查看MATLAB帮助文档进行了解。

MATLAB三维绘图(四)绘制特殊的三维图

原文:https://www.cnblogs.com/zhicungaoyuan-mingzhi/p/12447821.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!