admin 发表于 2015-11-19 19:16:29

Happy valentine's Day



【问题】
Stata能为情人节干嘛呢?
送点礼物吧,画个图。
【方法】
极坐标里面很有很多好玩的图
比如:Rose Curve
参考:
R送个情人节礼物,这个才真好
http://cos.name/2012/02/valentines-gift-by-using-r/
【求教】
Stata怎么给极坐标画图呢?
比如:很想把玫瑰r(θ)=a*sin(kθ)加到心形中间。
【例子】
drop _all
range t 0 2*_pi 1000
gen x=16*sin(t)^3
gen y=13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
egen x_min=min(x)
egen x_max=max(x)
egen y_min=min(y)
egen y_max=max(y)
gen a=(x-x_min)/(x_max-x_min)
gen b=(y-y_min)/(y_max-y_min)
line b a
gr_edit yaxis1.draw_view.setstyle, style(no)
gr_edit xaxis1.draw_view.setstyle, style(no)
gr_edit plotregion1.AddTextBox added_text editor .7055394244311991 .2810707216715078
gr_edit plotregion1.added_text_new = 1
gr_edit plotregion1.added_text_rec = 1
gr_edit plotregion1.added_text.style.editstyleangle(default) size(medsmall) color(red) horizontal(left) vertical(middle) margin(zero) linegap(zero) drawbox(no) boxmargin(zero) fillcolor(bluishgray) linestyle( width(thin) color(black) pattern(solid)) box_alignment(east) editcopy
gr_edit plotregion1.added_text.style.editstyle size(large) editcopy
gr_edit plotregion1.added_text.text = {}
gr_edit plotregion1.added_text.text.Arrpush Happy Valentine's Day

页: [1]
查看完整版本: Happy valentine's Day