matlab画同一张图两条线不同颜色,[转载]matlab 在一幅图中画同一颜色不同形状的线...

本文展示了一段使用Matlab进行数据绘图的代码实例。该示例通过定义不同的数据集,并利用Matlab的plot函数绘制了四条不同节点的数据曲线。此外,还通过句柄实现了对图中曲线的标记及图例的添加。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

a4c26d1e5885305701be709a3d33442f.png

%C.zhou2012.5.21

clc;

clear;

lemdatest=[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1];

vtest=[1 1.2 1.1 1.3 1.1 0.9 0.8 0.99 0.85 0.91;2.1 2.2 2.3 2.4 2.5

2.6 2.7 2.8 2.9 2.41;1.31 1.32 1.35 1.56 1.57 1.58 1.69 1.30 1.31

1.26;1.1 1.2 1.3 1.54 1.55 1.66 1.77 1.88 1.99 2.0];

plotid1=1;

plotid2=2;

plotid3=3;

plotid4=4;

plot(lemdatest,vtest(plotid1,:),'k');

h1=plot(lemdatest,vtest(plotid1,:),'k');%句柄

hold on;

plot(lemdatest,vtest(plotid2,:),'k');

h2=plot(lemdatest,vtest(plotid2,:),'k');

hold on;

plot(lemdatest,vtest(plotid3,:),'k');

h3=plot(lemdatest,vtest(plotid3,:),'k');

hold on;

plot(lemdatest,vtest(plotid4,:),'k');

h4=plot(lemdatest,vtest(plotid4,:),'k');

hhu=[h1,h2,h3,h4];

addmarkers(hhu,3);

hhulegend=addmarkers(hhu,3);

hold on;

legend(hhulegend,'节点7','节点31','节点12', '节点19');

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值