注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

随机过程

http://superware.blog.163.com

 
 
 

日志

 
 

Template for 2D diagram in asymptote  

2015-10-20 20:33:39|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

import graph;
import settings;

outformat = "pdf";

real Sin (real t) {return sin (2pi*t);}
real Cos (real t) {return cos (2pi*t);}

//========================================================================

picture pic, pic1, pic2, pic3, pic4;
guide gid1, gid2, gid3, gid4;
frame frm, frm1, frm2, frm3, frm4;


real width = 5.0cm, height = 5.0cm;
real min = 0.0cm, mout = 0.6cm;
real delta = 6.5cm;

// -----------------------------------------------------------------------

scale (pic1, Linear, Linear);
gid1 = graph (pic1, Cos, 0, 1);
draw (pic1, gid1, black + 1.2);

ylimits (pic1, -1, 1);

xaxis (pic1, "$t$", BottomTop, LeftTicks (N = 2));
yaxis (pic1, "$\sin t$", LeftRight, RightTicks (new real[] {-1, 0, 1}));

xequals(pic1, 0.5, Dotted);
yequals(pic1, 0.0, Dotted);

size (pic1, width, height, point (pic1, SW), point (pic1, NE));

label (pic1, "ONE", (0.5,0), red);

//frm1 = bbox (pic1, 0.5cm, 0.5cm, invisible);
frm1 = bbox (pic1, min, min);
add (pic, frm1);

// -----------------------------------------------------------------------

scale (pic2, Linear, Linear);
gid2 = graph (pic2, Cos, 0, 1);
draw(pic2, gid2 , black + 1.2);

ylimits (pic2, -1, 1);

xaxis (pic2, "$t$", BottomTop, LeftTicks (N = 2));
yaxis (pic2, "$\cos t$", LeftRight, RightTicks (new real[] {-1, 0, 1}));

xequals (pic2, 0.5, Dotted);
yequals (pic2, 0.0, Dotted);

size (pic2, width, height, point (pic2, SW), point (pic2, NE));

label (pic2, "TWO", (0.5,0), red);

//frm2 = bbox (pic2, 0.5cm, 0.5cm, invisible);
frm2 = bbox (pic2, min, min);
frm2 = shift (0,-delta)*frm2;
add (pic, frm2);

// -----------------------------------------------------------------------

scale (pic3, Linear, Linear);
gid3 = graph (pic3, Cos, 0, 1);
draw (pic3, gid3 , black + 1.2);

ylimits (pic3, -1, 1);

xaxis (pic3, "$t$", BottomTop, LeftTicks (N = 2));
yaxis (pic3, "$\cos t$", LeftRight, RightTicks (new real[] {-1, 0, 1}));

xequals (pic3, 0.5, Dotted);
yequals (pic3, 0.0, Dotted);

size (pic3, width, height, point (pic3, SW), point (pic3, NE));

label (pic3, "THREE", (0.5,0), red);

//frm3 = bbox (pic3, 0.5cm, 0.5cm, invisible);
frm3 = bbox (pic3, min, min);
frm3 = shift (delta, 0)*frm3;
add (pic, frm3);

// -----------------------------------------------------------------------

scale(pic4, Linear, Linear);
gid4 = graph (pic4, Cos, 0, 1);
draw (pic4, gid4 , black + 1.2);

ylimits (pic4, -1, 1);

xaxis (pic4, "$t$", BottomTop, LeftTicks (N = 2));
yaxis (pic4, "$\cos t$", LeftRight, RightTicks (new real[] {-1, 0, 1}));

xequals (pic4, 0.5, Dotted);
yequals (pic4, 0.0, Dotted);

size (pic4, width, height, point (pic4, SW), point (pic4, NE));

label (pic4, "FOUR", (0.5,0), red);

//frm4 = bbox (pic4, 0.5cm, 0.5cm, invisible);
frm4 = bbox (pic4, min, min);
frm4 = shift (delta,-delta)*frm4;
add (pic, frm4);

// -----------------------------------------------------------------------

frm = bbox (pic, mout, mout, invisible);
add (frm);

Template for 2D diagram in asymptote - superware - 随机过程

模板说明:

1. 该模板用于 2D 数据可视化,其中每个图片有边框,该边框在实际作图时应该去掉,去掉边框的方法只需将每个 pic_i 边框设置函数 bbox 的可视参数设置为 invisible 即可。

2. 模板中的各个参数都可以精细调节,比 Gnuplot 更灵活,图片质量也不输 Gnuplot。


去掉边框后的图
Template for 2D diagram in asymptote - superware - 随机过程
  评论这张
 
阅读(90)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017