Matlab-多曲线画法和点标记

为了避免自己忘记,写个笔记吧。

先上效果图:

然后是代码,主要是为了自己不忘记,而且自己是新手,所以没有遵守代码规范,有问题评论问我吧。

clc;
x_1 = 0.01:0.01:0.99;
x_2 = 1.01:0.01:10.0;
note = ["a_{1}","a_{2}","a_{3}","a_{4}","a_{5}"];
C = linspecer(5);
hold on;
h1 = plot(x_1 ,y(1:99,1), x_2, y(100:999,1),'-','color',C(1,:),'LineWidth',2);
h2 = plot(x_1 ,y(1:99,2), x_2, y(100:999,2),'-','color',C(2,:),'LineWidth',2);
h3 = plot(x_1 ,y(1:99,3), x_2, y(100:999,3),'-','color',C(3,:),'LineWidth',2);
h4 = plot(x_1 ,y(1:99,4), x_2, y(100:999,4),'-','color',C(4,:),'LineWidth',2);
h5 = plot(x_1 ,y(1:99,5), x_2, y(100:999,5),'-','color',C(5,:),'LineWidth',2);
%设置标记点和标记文字
plot(2.31, 0.55936, "r.", "MarkerSize",12);
text(2.31, 0.54000, "(2.31, 0.55936)");
plot(0.34, 0.4117, "r.", "MarkerSize",12);
text(0.51, 0.42, "(0.34, 0.4117)");
%设置图例
legend([h1(1,1),h2(1,1), h3(1,1), h4(1,1), h5(1,1)], "a_1","a_2","a_3","a_4","a_5", 'fontsize', 12);
set(gca, 'XLim', [0,10]);
ylabel('\Delta','Fontname','微软雅黑','fontsize',12,'rotation',0);%x轴标记
xlabel('\alpha','Fontname','微软雅黑','fontsize',12);%y轴标记
grid on;

 

  • 8
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值