Stata绘图:绘制一颗红心-姑娘的生日礼物

发布时间:2020-10-08 阅读 3911

Stata 连享会   主页 || 视频 || 推文

温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。

课程详情 https://gitee.com/arlionn/Course   |   lianxh.cn

课程主页 https://gitee.com/arlionn/Course

知乎上截取的:

Stata-心形-生日快乐!
Stata-心形-生日快乐!
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 .605 .33
gr_edit plotregion1.added_text_new = 1
gr_edit plotregion1.added_text_rec = 1
gr_edit plotregion1.added_text[1].style.editstyle angle(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[1].style.editstyle size(large) editcopy
gr_edit plotregion1.added_text[1].text = {}
gr_edit plotregion1.added_text[1].text.Arrpush 亲爱的,生日快乐!

美化一下:其实是有动画效果的——我的心在颤抖!

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, lc(red*1.2) lw(*20)

gr_edit yaxis1.draw_view.setstyle, style(no)
gr_edit xaxis1.draw_view.setstyle, style(no)
gr_edit plotregion1.AddTextBox added_text editor .605 .33
gr_edit plotregion1.added_text_new = 1
gr_edit plotregion1.added_text_rec = 1
gr_edit plotregion1.added_text[1].style.editstyle angle(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[1].style.editstyle size(large) editcopy
gr_edit plotregion1.added_text[1].text = {}
gr_edit plotregion1.added_text[1].text.Arrpush 亲爱的,生日快乐!
My_heart-Stata.png
My_heart-Stata.png

作者:章维龙 链接:https://www.zhihu.com/question/25366124/answer/42388196 来源:知乎

相关课程

连享会-直播课 上线了!
http://lianxh.duanshu.com

免费公开课:


课程一览

支持回看,所有课程可以随时购买观看。

专题 嘉宾 直播/回看视频
最新专题 DSGE, 因果推断, 空间计量等
Stata数据清洗 游万海 直播, 2 小时,已上线
研究设计 连玉君 我的特斯拉-实证研究设计-幻灯片-
面板模型 连玉君 动态面板模型-幻灯片-
面板模型 连玉君 直击面板数据模型 [免费公开课,2小时]

Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。


关于我们

  • Stata连享会 由中山大学连玉君老师团队创办,定期分享实证分析经验。直播间 有很多视频课程,可以随时观看。
  • 连享会-主页知乎专栏,300+ 推文,实证分析不再抓狂。
  • 公众号推文分类: 计量专题 | 分类推文 | 资源工具。推文分成 内生性 | 空间计量 | 时序面板 | 结果输出 | 交乘调节 五类,主流方法介绍一目了然:DID, RDD, IV, GMM, FE, Probit 等。
  • 公众号关键词搜索/回复 功能已经上线。大家可以在公众号左下角点击键盘图标,输入简要关键词,以便快速呈现历史推文,获取工具软件和数据下载。常见关键词:课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法

连享会主页  lianxh.cn
连享会主页 lianxh.cn

连享会小程序:扫一扫,看推文,看视频……

扫码加入连享会微信群,提问交流更方便

✏ 连享会学习群-常见问题解答汇总:
https://gitee.com/arlionn/WD