双向低音如何改变传奇中符号的颜色

时间:2017-12-12 19:51:23

标签: stata

我试图改变图例中两条线的颜色,以获得双向低地图。

我的代码如下:

twoway (lowess y x if z == 0) (lowess y x if z == 1), ///  
        title("Probabilistic Relationship between Incidence of Y and Diagnosis of X") ///  
        ytitle(Probability of Incidence of Y)                  ///  
        ylabel(0.0 0.05 0.10 0.15 0.20)                            ///  
        xtitle(Diagnosis of X)                      ///  
        legend(label(1 "Non-Z") label(2 "Current Z")) ///  
        rline(lcolor(1 "eltblue") (2 "eltgreen"),                       ///  
        lstyle(1 "solid") (2 "solid"))                          ///  
        note("Anonymous Project")  

我不断在各种代码行上出错,特别是对于rline和lstyle。我应该使用哪些选项来编辑图中线条的颜色以及相应的图例? lcolor和rline选项不起作用。请指导我如何解决这个问题!

1 个答案:

答案 0 :(得分:2)

这是一个可重复的例子:

sysuse auto
tw (lowess price mpg if foreign==1, lcolor(orange)) (lowess price mpg if foreign==0, lcolor(navy)), legend(label(1 "Foreign Cars") label(2 "Domestic Cars")) 

这是输出:

enter image description here

相关问题