matlab plot函数程序

时间:2021-08-11 10:26:35
【文件属性】:
文件名称:matlab plot函数程序
文件大小:585B
文件格式:M
更新时间:2021-08-11 10:26:35
函数程序 matlab中二维线画图函数 1. plot(x,y); %x y 为相应点集 2.plot(x,y1,x,y2); % 在一个窗口下绘制多条曲线之方法一 3.hold on %在一个窗口下绘制多条曲线之方法二 plot(x,y1); plot(x,y2); hold off 4.plot后 xlabel('x_axis_name'); %设置x y轴名称 ylabel('x_axis_name'); title('name'); %设置图名称 5.线型和颜色 线型(线方式): - 实线 :点线 -. 虚点线 - - 波折线 线型(点方式):. 圆点 +加号 * 星号 x x形 o 小圆 线条粗细:plot(x,y,'r','linewidth',4); 颜色: r红; g绿; b蓝; c青 m紫; k黑; w白;y黄; 例子: plot(x,y1,’b:+’,x,y2,’g-.*’); 6.加图例legend legend(字符串1,字符串2,字符串3,…,参数); %其中字符串为画图顺序依次标注,参数说明如下: 参数字符串 含 义 0 尽量不与数据冲突,自动放置在最佳位置 1 放置在图形的右上角 2 左上角 3 左下角 4 右下角 -1 图形窗外 7.设置背景色 set(gcf,'color','none'); %无背景 set(gcf,'color',[0,0,0]); %背景色为黑 set(gcf,'color',[1,1,1]); %背景色为白

网友评论