楼主: lixuewei3
21533 11

[作图问题求助] 如何用stata把两张图放在同一个坐标轴里表示 [推广有奖]

  • 6关注
  • 5粉丝

已卖:127份资源

副教授

67%

还不是VIP/贵宾

-

威望
0
论坛币
-330314 个
通用积分
3352.3510
学术水平
20 点
热心指数
38 点
信用等级
24 点
经验
30041 点
帖子
1066
精华
0
在线时间
710 小时
注册时间
2014-1-13
最后登录
2024-4-23

楼主
lixuewei3 发表于 2015-4-14 13:38:19 |AI写论文
5论坛币
如何用stata把两张图放在同一个坐标轴里表示
https://bbs.pinggu.org/forum.php?mod=viewthread&tid=3663424&from^^uid=4876198


最佳答案

xingyun1688 查看完整内容

. sysuse lifeexp, clear . gen loggnp = log10(gnppc) . label var loggnp "Log base 10 of GNP per capita" . scatter lexp loggnp, ysca(alt) xsca(alt) xlabel(, grid gmax) saving(yx) . twoway histogram lexp, fraction xsca(alt reverse) horiz saving(hy) . twoway histogram loggnp, fraction ...
关键词:Stata tata 如何用 坐标轴 thread fromuid 坐标轴 如何

沙发
xingyun1688 学生认证  发表于 2015-4-14 13:38:20
lixuewei3 发表于 2015-4-16 21:22
graph combine happiness[spousehappiness]
happiness[spousehappiness] is not a memory graph
r(198) ...
. sysuse lifeexp, clear

        . gen loggnp = log10(gnppc)

        . label var loggnp "Log base 10 of GNP per capita"

        . scatter lexp loggnp,
                ysca(alt) xsca(alt)
                xlabel(, grid gmax)      saving(yx)

        . twoway histogram lexp, fraction
                xsca(alt reverse) horiz  saving(hy)

        . twoway histogram loggnp, fraction
                ysca(alt reverse)
                ylabel(,nogrid)
                xlabel(,grid gmax)       saving(hx)

        . graph combine hy.gph yx.gph hx.gph,
                hole(3)
                imargin(0 0 0 0) graphregion(margin(l=22 r=22))
                title("Life expectancy at birth vs. GNP per capita")
                note("Source:  1998 data from The World Bank Group")

例子你看看
已有 2 人评分经验 论坛币 学术水平 热心指数 收起 理由
happy_287422301 + 40 + 2 热心帮助其他会员
SpencerMeng + 100 + 1 + 1 观点有启发

总评分: 经验 + 100  论坛币 + 40  学术水平 + 3  热心指数 + 1   查看全部评分

藤椅
nathanlin7 发表于 2015-4-14 13:51:29
http://www.stata.com/help.cgi?graph+combine
已有 1 人评分经验 热心指数 收起 理由
SpencerMeng + 100 + 1 观点有启发

总评分: 经验 + 100  热心指数 + 1   查看全部评分

板凳
lixuewei3 发表于 2015-4-14 23:52:33
nathanlin7 发表于 2015-4-14 13:51
http://www.stata.com/help.cgi?graph+combine
都试过,好像不行

报纸
蓝色 发表于 2015-4-15 12:47:10
有的图放在一起有意义
而直方图放在一起,没有多大意思但你画其他图形,如下面的核密度曲线,就没有问题
https://bbs.pinggu.org/thread-2437711-1-1.html
已有 1 人评分经验 收起 理由
SpencerMeng + 100 观点有启发

总评分: 经验 + 100   查看全部评分

地板
nathanlin7 发表于 2015-4-15 17:56:24
如果实在放不在一起,并排对比也可以的,大家能够看明白的。

7
zanglq 发表于 2015-4-16 16:29:04
最近刚开始学,刚好看到这个,应该是graph combine name[name][,option]
希望对你有用

8
zanglq 发表于 2015-4-16 16:30:10
最近刚开始学,刚好看到这个,应该是graph combine name[name][,option]
希望对你有用

9
xingyun1688 学生认证  发表于 2015-4-16 16:44:20
最近刚开始学,刚好看到这个,应该是graph combine name[name][,option]
希望对你有用

10
lixuewei3 发表于 2015-4-16 21:21:34
xingyun1688 发表于 2015-4-16 16:44
最近刚开始学,刚好看到这个,应该是graph combine name[name][,option]
希望对你有用
graph combine happiness[spousehappiness]
happiness[spousehappiness] is not a memory graph
r(198);

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 14:18