利用sas制作贺卡的代码
朋友过生日、或者过年过节你都可以制作贺卡送给朋友。如果嫌手工版的太麻烦,那你也可以制作一份电子版的贺卡送给你的朋友。但是又有疑问了,如果你不是技术宅不会制作电子贺卡怎么办。下面就有一个利用sas制作贺卡代码。
Sas制作贺卡方法一:
下面这段代码使用传统的SAS/GRAPH制图。
* Make your card with your most favorite image;
filename getgraph 'C:newyear_cardMonkey01.jpg';
goptions hsize=6 vsize=6;
proc gslide iframe=getgraph imagestyle=fit;
note move = (2, 2) height = 2 'Emily Gao';
run;
quit;
绘图的结果文件在SAS进程的临时文件目录下。
Sas制作贺卡方法二:
如果你的SAS版本支持 ODS GRAPHICS,则可以用 SGPLOT 绘图。觉得盗图签名太简单?没有数学公式和分析,太 low? 那就用数学公式算出心型图的数据,再嵌上你喜欢的图片。
* Make your card with your most favorite image drawn in a hart shape;
data heart;
length side $ 8;
pi=constant('PI');
do t=0 to 60 by 100/200;
x = -.01*(-t**2+40*t+1200)*sin(pi*t/180);
y = .01*(-t**2+40*t+1200)*cos(pi*t/180);
side='left';
output;
side='right';
x=-1*x;
output;
end;
run;
data anno;
length function $5.;
retain function 'move' function 'image' width 50 drawspace 'graphpercent';
x1 = 50; y1 = 50; image = 'C:sbjgaynewyear_cardMonkey01.jpg';
imagescale = 'fit';
function = 'image';
output;
x1 = 75; y1 = 70; function = 'text'; width=80; widthunit = 'percent';
textcolor = 'black'; textweight = 'bold'; textsize=10;
x1=50; y1=15; label='To My Best Friend';
output;
x1=50; y1=10; label='Emily Gao';
output;
run;
ods listing;
ods graphics / width=600px height=600px noborder;
proc sgplot data=heart sganno=anno noautolegend;
series x=x y=y /group=side lineattrs=(color=red);
xaxis display=none;
yaxis display=none;
run;quit;
ods graphics off;
Sas制作贺卡方法三:
你还可以选四幅自己喜欢的图片,做个小四副贺卡。注意,gslide 和 ods graphics 这两种绘图技术使用的 annotation 数据格式略有不同。
* Make your card with your most 4 favorite images;
data anno;
length function $5.;
retain function 'move' function 'image' xsys '3' ysys '3';
x = 0; y = 0; function = 'move';
output;
x = 50; y = 50; imgpath = 'C:sbjgaynewyear_cardMonkey02.jpg';
style = 'fit';
function = 'image';
output;
x = 0; y = 50; function = 'move';
output;
x = 50; y = 100; imgpath = 'C:sbjgaynewyear_cardMonkey03.jpg';
style = 'fit';
function = 'image';
output;
x = 50; y = 50; function = 'move';
output;
x = 100; y = 100; imgpath = 'C:sbjgaynewyear_cardMonkey05.jpg';
style = 'fit';
function = 'image';
output;
x = 50; y = 50; function = 'move';
output;
x = 100; y = 0; imgpath = 'C:sbjgaynewyear_cardMonkey04.jpg';
style = 'fit';
function = 'image';
output;
run;
proc gslide anno=anno;
run;quit;
* Make your card with your most 4 favorite images and ods graphics;
data null;
length side $ 8;
x = 0;
y = 0;
side='left';
output;
run;
data anno;
length function $5.;
retain function 'move' function 'image' width 40 drawspace 'graphpercent';
x1 = 25; y1 = 25; image = 'C:sbjgaynewyear_cardMonkey02.jpg';
imagescale = 'fit';
function = 'image';
output;
x1 = 25; y1 = 70; image = 'C:sbjgaynewyear_cardMonkey03.jpg';
imagescale = 'fit';
function = 'image';
output;
x1 = 75; y1 = 25; image = 'C:sbjgaynewyear_cardMonkey05.jpg';
imagescale = 'fit';
function = 'image';
output;
x1 = 75; y1 = 70; image = 'C:sbjgaynewyear_cardMonkey04.jpg';
imagescale = 'fit';
function = 'image';
output;
x1 = 75; y1 = 70; function = 'text'; width=80; widthunit = 'percent';
textcolor = 'black'; textweight = 'bold'; textsize=10;
x1=50; y1=50; label='To My Best Friend';
output;
x1=50; y1=45; label='Emily Gao';
output;
run;
ods listing;
ods graphics / width=600px height=600px noborder;
proc sgplot data=null sganno=anno noautolegend;
series x=x y=y /group=side lineattrs=(color=red);
xaxis display=none;
yaxis display=none;
run;quit;
ods graphics off;
以上全部就是利用SAS制作贺卡的代码的介绍。如果你想找制作贺卡服务,或者了解更多制作贺卡资讯,就上网。网入驻上百家专业制作贺卡公司,汇集全国千万优秀专业人才,提供最全面、最专业的制作贺卡服务。