分享两个matlab绘图函数
分享两个matlab绘图函数
1. drawdot.m
%描点,参数x,y分别为x轴,y轴数据向量
function drawdot(x,y)
plot(x,y,'.','markersize',10,'color','k');
xlabel(input('请输入x标签:','s'),'fontsize',14);
ylabel(input('请输入y标签:','s'),'fontsize',14);
2. drawline.m
%绘制光滑曲线,参数x,y分别为x轴,y轴数据向量
function drawline(x,y)
plot(x,y,'.','markersize',10,'color','k');
hold on;
x0=min(x):0.01:max(x);
y0=pchip(x,y,x0);
plot(x0,y0,'linewidth',1,'color','k');
xlabel(input('请输入x标签:','s'),'fontsize',14);
ylabel(input('请输入y标签:','s'),'fontsize',14);
多次调用drawline可实现同一幅图中画多条曲线。
2条评论
Buy CBD
What’s up, I want to subscribe for this weblog to get most recent updates,
therefore where can i do it please assist.
Also visit my web-site; Buy CBD
bedava
Great post! We are linking to this particularly great content on our website. Keep up the great writing. Kirsten Augie Olive