首先,推荐一个讲Matlab画图的链接,该文中的画图方法比较基础,入门很快。
http://blog.csdn.net/wangcj625/article/details/6287735
下面给出一个例子。
eg. 有两条曲线,X轴的区间是相同的,并且采样点个数相同。第一条曲线使用红色,第二条曲线使用绿色。需要标识出X轴坐标名称和Y轴坐标名称,还需要对标识出曲线名称。
生成矢量图格式:1. 保存成pdf和eps等文件,再通过Corel Draw将pdf或eps文件转换成wmf格式的矢量图,这样就可以在word中加入矢量图格式;2. 将Matlab的图直接保存成emf格式也是一种方法。
Matlab作图看上去是没有反锯齿的,但可以开启smoothing的函数。开启smoothing后,pdf格式输出的文件就不是矢量图咯~
上面的图就是开启smoothing功能的效果图。
1 Val1 = load('data1.txt'); % Load the data 2 Val2 = load('data2.txt'); % Load the data 3 X = load('XAxis.txt'); 4 5 % Plot the curve with red solid line and the linewidth is 2 6 curvehandle = plot(X,Val1,'r-',X,Val2,'g-','linewidth',1.5); 7 % Turn on linesmoothing 8 set(curvehandle,'linesmoothing','on'); 9 10 xlabel('Iterations','fontname','Times New Roman','fontsize',12); 11 ylabel('Percent of Final Value/%','fontname','Times New Roman','fontsize',12); 12 legend('Correctness','Inverse of Correctness'); 13 axis([0,200,0.2,3.5]); % Set the boundary