五星红旗?sgplot+scatter轻松实现
参考代码
data star;
x1=0.5;y1=4.0;output;
x2=1.5;y2=3.0;output;
x2=2.0;y2=3.5;output;
x2=2.0;y2=4.0;output;
x2=1.5;y2=4.5;output;
run;
ods graphics/width=500 height=350;
proc sgplot data=star nosuyolegend;
styleattrs wallcolor=red;
scatter x=x1 y=y1/markerattrs=(symbol=starfilled color=yellow size=40);
scatter x=x2 y=y2/markerattrs=(symbol=starfilled color=yellow size=20);
yaxis display=(noline nolabel noticks novalues) values=(0 to 5 by 1);
xaxis display=(noline nolabel noticks novalues) values=(0 to 5 by 1);
run;
上面code运行后的graph如下,嘿嘿
哆啦A梦?机器猫?给大家拜个晚年
参考代码
data p1;
pi = constant('pi');
do tau = -pi to pi by pi/100;
x = cos(tau);
y = 0.95*sin(tau)+1;
id=1;
output;
end;
do tau = 0.62*pi to 2.38*pi by pi/100;
x = cos(tau)*0.8;
y = 0.95*sin(tau)*0.8+0.8;
id=2;
output;
end;
do tau = -pi to pi by pi/100;
x = cos(tau)*0.1;
y = sin(tau)*0.1+0.9;
id=3;
output;
end;
do tau = -pi to pi by pi/100;
x = 0.5*cos(tau)*0.3-0.15;
y = sin(tau)*0.3+1.5;
id=4;
output;
end;
do tau = -pi to pi by pi/100;
x = 0.5*cos(tau)*0.3+0.15;
y = sin(tau)*0.3+1.5;
id=5;
output;
end;
do tau = -pi to pi by pi/100;
x = 0.3*cos(tau)*0.2+0.15;
y = 0.5*sin(tau)*0.2+1.35;
id=6;
output;
end;
do tau = -pi to pi by pi/100;
x = 0.3*cos(tau)*0.2-0.15;
y = 0.5*sin(tau)*0.2+1.35;
id=7;
output;
end;
do tau = pi to 2*pi by pi/100;
x = cos(tau)*0.3;
y = 0.8*sin(tau)*0.3+0.5;
id=8;
output;
end;
x=-0.3; y=0.8; id=9; output; x=-0.85; y=0.8; id=9; output;
x=0.3; y=0.8; id=10; output; x=0.85; y=0.8; id=10; output;
x=0.3; y=0.7; id=11; output; x=0.85; y=0.6; id=11; output;
x=-0.3; y=0.7; id=12; output; x=-0.85; y=0.6; id=12; output;
x=-0.3; y=0.9; id=13; output; x=-0.85; y=1.0; id=13; output;
x=0.3; y=0.9; id=14; output; x=0.85; y=1.0; id=14; output;
x=0.3; y=0.5; id=15; output; x=-0.3; y=0.5; id=15; output;
x=0; y=0.8; id=16; output; x=0; y=0.5; id=16; output;
run;
proc sgplot data=p1 noborder noautolegend aspect=1;
polygon x=x y=y id=id / colorresponse=id fill colormodel=(skyblue white red white white black black red black black black black black black black black);
series x=x y=y / group=id colorresponse=id colormodel=(black black black black black black black black black black black black black black black black) lineattrs=(color=black pattern=1 thickness=0.1cm);
xaxis display=none;
yaxis display=none;
run;
上面code运行后的graph如下