SAS中文论坛

标题: label in proc sgplot [打印本页]

作者: shiyiming    时间: 2010-12-1 13:03
标题: label in proc sgplot
[code:1384u7vv]data class;
        set sashelp. class;
        if age <13 then ref = 90;
        else ref =        120;
run;

proc sgplot;
        scatter x = age y = weight;
        refline ref/axis = y label =('normal' 'over-weighted');
run; quit;[/code:1384u7vv]
诸位,或许你们已经注意到,在这个code里label 选项是无效的。一下的改写是有效的
[code:1384u7vv]refline 90 120/axis = y label =('normal' 'over-weighted');[/code:1384u7vv]
我的问题是如果refline的值是从变量而来,有没有办法在参考线上写label?
另外sas在此处的help file很奇怪的,害得我试了两个小时。。。
问题2:
ods escapechar='^';
ods rtf;proc sgplot; xaxis label =...;

。。如何写log10, 10为下标
我想当然用了 "log^{unicode '2081'x}^{unicode '2080'x}";
结果rtf file给了我两个小方框空格,应该怎么写呢?
京剧
作者: shiyiming    时间: 2010-12-1 15:16
标题: Re: label in proc sgplot
1, 想通用一些,用macro变量吧。

好像不可以重叠在一起,当时可以表在参考线的上面一些位置。如下:
设置  LABELPOS= Max LABELLOC=inSIDE ,可以稍微改变label位置,灵活度不大(2*2=4个位置可选)

如果想随心所欲标label的话,anoate最佳。

2,SAS没有提供便利的上下标方法,
不过a,提供给title和footnote一个方法
samle:
title1 h=1.5 "here is  log"                                                                                                  
       move=(-0,-.75) h=1 "10"                                                                                                                 
       move=(-0,-.75) h=1.5 "(5x+10)   form";   
b,anonte
作者: shiyiming    时间: 2010-12-2 03:12
标题: Re: label in proc sgplot
谢谢诸位,非常有见地。
看样子用macro是一种选择了。




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2