matlab 作图-留着发论文时备用

clc;clear all;


set(0,'defaultfigurecolor','w');    % 设置背景为白色,黑色不适合放在论文里面
fontsize = 15;      % 定义一个fontsize变量方便以后使用
x=0:0.2:8;
y1=0.2+sin(-2*x);  % 曲线1
y2=sin(x.^0.5);    % 曲线2
y3=sin(x);
figure
% plot(x,y1,'g-+',x,y2,'r--d');
plot(x,y1,'b--o','Linewidth',1.5);hold on;
plot(x,y2,'r-+','Linewidth',1.5);hold on;
% plot(x,y3,'k:','Linewidth',1.2);hold on;


% title('标题!');
xlabel('时间 time','Fontsize',fontsize);
ylabel({'幅值';'The float value'},'Fontsize',fontsize);


h=legend(['曲线1',sprintf('\n')],['曲线2',sprintf('\n')],'location','North');
set(gca,'ygrid','on')
set(h,'Box','on');  % 文本有框框
set(h,'Fontsize',fontsize);


图示:


参考了:http://jingyan.baidu.com/article/f006222806b6dcfbd2f0c879.html

猜你喜欢

转载自blog.csdn.net/md_555/article/details/51661071
今日推荐