Matlab绘制多个折线图的方法

给出一个Matlab绘制折线图的例子:Matlab绘制多个折线图和子图的详细方法,并且字体设置为Times New Roman,可用于普通课程作业的撰写。

%% 维数选择
% 人脸1.f
Dim = 10:10:100;
%% 数据选择
% 人脸1.f
RKSH = [53 68 74 77 77 78 78 78 78 78];
RKSHs = [73 81 84 84 85 86 88 88 88 88];
TCA = [63 73 74 78 77 78 78 78 79 79];
TCAs = [72 81 84 83 85 86 88 88 88 88];
IGLDA = [61 73 77 78 78 80 81 81 81 81];
IGLDAs = [72 81 84 83 85 86 88 88 88 88];
TIT = [58 68 72 76 76 75 74 75 75 75];
TITs = [62 71 76 78 79 79 81 82 83 82];
%% 画图
%1
subplot(2,2,1)
plot(Dim,RKSH,'-*b',Dim,RKSHs,'-or'); %线性,颜色,标记
%title('RKHS-DA AND SLDARKHS-DA');
axis( [0,110,50,100])  %确定x轴与y轴框图大小
set(gca,'XTick',[0:10:110]) %x轴范围
set(gca,'YTick',[50:10:100]) %y轴范围
legend('RKHS-DA','SLDARKHS-DA','Location','SouthEast', 'FontName','Times New Roman','FontSize',8,'FontWeight','normal');   %右下角标注
xlabel('Dimensionality of Subspace', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal')  %x轴坐标描述
ylabel('Accuracy (%)', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal') %y轴坐标描述
%2
subplot(2,2,2)
plot(Dim,TCA,'-*b',Dim,TCAs,'-or'); %线性,颜色,标记
%title('TCA AND SLDA-TCA');
axis( [0,110,50,100])  %确定x轴与y轴框图大小
set(gca,'XTick',[0:10:110]) %x轴范围
set(gca,'YTick',[50:10:100]) %y轴范围
legend('TCA','SLDA-TCA','Location','SouthEast', 'FontName','Times New Roman','FontSize',8,'FontWeight','normal');   %右下角标注
xlabel('Dimensionality of Subspace', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal')  %x轴坐标描述
ylabel('Accuracy (%)', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal') %y轴坐标描述
%3
subplot(2,2,3)
plot(Dim,IGLDA,'-*b',Dim,IGLDAs,'-or'); %线性,颜色,标记
%title('IGLDA AND SLDA-IGLDA');
axis( [0,110,50,100])  %确定x轴与y轴框图大小
set(gca,'XTick',[0:10:110]) %x轴范围
set(gca,'YTick',[50:10:100]) %y轴范围
legend('IGLDA','SLDA-IGLDA','Location','SouthEast', 'FontName','Times New Roman','FontSize',8,'FontWeight','normal');   %右下角标注
xlabel('Dimensionality of Subspace', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal')  %x轴坐标描述
ylabel('Accuracy (%)', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal') %y轴坐标描述
%4
subplot(2,2,4)
plot(Dim,TIT,'-*b',Dim,TITs,'-or'); %线性,颜色,标记
%title('TIT AND SLDA-TIT');
axis( [0,110,50,100])  %确定x轴与y轴框图大小
set(gca,'XTick',[0:10:110]) %x轴范围
set(gca,'YTick',[50:10:100]) %y轴范围
legend('TIT','SLDA-TIT','Location','SouthEast', 'FontName','Times New Roman','FontSize',8,'FontWeight','normal');   %右下角标注
xlabel('Dimensionality of Subspace', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal')  %x轴坐标描述
ylabel('Accuracy (%)', 'FontName','Times New Roman','FontSize',11,'FontWeight','normal') %y轴坐标描述

图片示例(直接运行结果):
在这里插入图片描述
一些线型和颜色的设置参数:
在这里插入图片描述
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值