STATA绘图学习笔记——分组画图的标题设置问题

【问题】

使用分组命令画散点图时,按照一般标题命令输入后,标题自动分配到了两个小组内,

scatter tier1 tier2 unhealthy ragey, by(female,  rows(1)) ///
title("健康随年龄增长的变化趋势:韩国", color(black)) ///
legend(order(1 "最健康" 2 "一般健康" 3 "不健康") ///
rows(1) ring(0) position(12) bexpand) ///
        ytitle("健康水平%") ///
        xtitle("年龄") ///        
        scheme( s1color)

结果如下图所示:

我想要一个总标题,因此翻看了STATA用户手册后找到了解决方法:

【新命令】

scatter tier1 tier2 unhealthy ragey, by(female, title("健康随年龄增长的变化趋势:韩国", color(black)) rows(1)) ///
legend(order(1 "最健康" 2 "一般健康" 3 "不健康") ///
rows(1) ring(0) position(12) bexpand) ///
		ytitle("健康水平%") ///
		xtitle("年龄") ///		
		scheme( s1color)

最终效果:

 ❓但是目前仍然存有一个疑问,如何用命令删除左下角的“graphs by female”?

✅找到解决方法了!

#去掉图中的“graphs by XX”

//Put the note("") inside the by():

【原】stripplot L2, subtitle("") note("") over(emot4cat) by(situs) bar(level(95)) cumulate scheme(s1color) ytitle("")

【改】stripplot L2, subtitle("")  over(emot4cat) by(situs, note("")) bar(level(95)) cumulate scheme(s1color) ytitle("")

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值