码迷,mamicode.com
首页 > 其他好文 > 详细

Matlab作图及反锯齿

时间:2014-12-02 20:44:59      阅读:1910      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   os   使用   sp   

首先,推荐一个讲Matlab画图的链接,该文中的画图方法比较基础,入门很快。

http://blog.csdn.net/wangcj625/article/details/6287735

 

下面给出一个例子。

eg. 有两条曲线,X轴的区间是相同的,并且采样点个数相同。第一条曲线使用红色,第二条曲线使用绿色。需要标识出X轴坐标名称和Y轴坐标名称,还需要对标识出曲线名称。

bubuko.com,布布扣

Matlab作图看上去是没有反锯齿的,但可以生成矢量图格式,比如pdf和eps等。再通过Corel Draw生成wmf格式的矢量图,这样就可以在word中加入矢量图格式。此外Matlab有开启smoothing的函数,但开启smoothing后,pdf格式输出的文件就不是矢量图咯~因此推荐第一种方式生成矢量图。

bubuko.com,布布扣

上面的图就是开启smoothing功能的效果图。

Val1 = load(‘data1.txt‘);           % Load the data
Val1 = Val1‘;                       % matrix transpose
Val1 = 100*Val1;                    % Enlarge the data by 100
Val2 = 1./Val1;
X = 1:1:424;
curvehandle = plot(X,Val1,‘r-‘,X,Val2,‘g-‘,‘linewidth‘,1.5);    % plot the curve with red real line and linewidth is 2
set(curvehandle,‘linesmoothing‘,‘on‘);
xlabel(‘Iterations‘,‘fontname‘,‘Times New Roman‘,‘fontsize‘,12);
ylabel(‘Percent of Final Value/%‘,‘fontname‘,‘Times New Roman‘,‘fontsize‘,12);
legend(‘Correctness‘,‘Inverse of Correctness‘);
axis([0,200,0.2,3.5]);              % Set the boundary

 

Matlab作图及反锯齿

标签:style   blog   http   io   ar   color   os   使用   sp   

原文地址:http://www.cnblogs.com/JunxuanBai/p/4138295.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!