Matlab三维折线图绘制–surf 函数的使用
最近在写毕业论文,整理数据需要绘制一个简单的三维图,简单做个分享!
先上结果图:
最后附上代码:
clc,clear,close all;
% filename = 'outFFE\';
% namelist = dir(filename+'*.mat');
% len = length(namelist);
x = 5:2:25;% x轴
y = 2:2:12;% y轴
%xy坐标平面对应的z值
z = zeros(length(y),length(x));
z(1,1)=3.29E-01; z(1,2)=2.00E-01; z(1,3)=1.94E-01; z(1,4)=1.82E-01; z(1,5)=1.66E-01; z(1,6)=1.39E-01; z(1,7)=1.36E-01; z(1,8)=1.17E-01; z(1,9)=1.00E-01; z(1,10)=1.10E-01; z(1,11)=1.09E-01; z(2,3)=1.38E-01; z(2,4)=1.26E-01; z(2,5)=1.09E-01; z(2,6)=1.02E-01; z(2,7)=9.87E-02; z(2,8)=9.87E-02; z(2,9)=7.12E-02; z(2,10)=7.16E-02; z(2,11)=6.95E-02; z(3,5)=1.11E-03; z(3,6)=4.73E-04; z(3,7)=5.73E-04; z(3,8)=2.03E-04; z(3,9)=3.53E-04; z(3,10)=4.10E-04; z(3,11)=4.00E-04; z(4,7)=4.30E-04; z(4,8)=2.20E-04; z(4,9)=2.30E-04; z(4,10)=2.33E-04; z(4,11)=1.09E-04; z(5,9)=3.27E-04; z(5,10)=4.57E-04; z(5,11)=1.13E-04; z(6,11)=3.60E-04;
figure(1)
surf(x,y,log10(z));%绘制图形,以x为x轴,y为y轴
文章来源:https://www.toymoban.com/news/detail-552473.html
xlabel('x')
ylabel('y')
zlabel('log _{10}_ (BER)')
%legend({'log _{10}_ (BER)'},'Location','northwest','Orientation','horizontal')%水平
colormap cool%cool是一种配色方案,还有其他方案如winter,summer····见help colormap
colorbar%图例
文章来源地址https://www.toymoban.com/news/detail-552473.html
到了这里,关于Matlab三维折线图绘制–surf 函数的使用的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!