1

我试图在针图中绘制不同水平的工资,我想要一条参考线。下面的代码提供了这条参考线,但是这条线和针的颜色一样,而且太细了。有没有办法改变这个?

SYMBOL1
    INTERPOL=NEEDLE
    HEIGHT=10pt
    VALUE=NONE
    LINE=1
    WIDTH=2
    CV = _STYLE_
;
Axis1
    STYLE=1
    WIDTH=1
    MINOR=NONE
    REFLABEL=(j=c color = red width = 5 '');
;
Axis2
    STYLE=1
    WIDTH=1
    MINOR=NONE
;
TITLE;
TITLE1 "Bootstrap: Needle Plot of log salary";
PROC GPLOT 
    DATA = sashelp.baseball
    ;
    PLOT logsalary * name /
        VAXIS = AXIS1
        HAXIS = AXIS2
        VREF  = 4
    ;
RUN; QUIT;
4

1 回答 1

1

参考线的颜色和宽度由语句的VREF,CVREFWVREF选项上的枚举列表控制。PLOT参考线的标签和颜色必须手动与AXIS语句中的类似枚举列表对齐。

可以使用注释数据集对绘图过程进行额外控制。特别是,可以指定在程序完成其绘制之后绘制注释,并且渲染的结果出现在程序输出的顶部。

例子

SYMBOL1 INTERPOL=NEEDLE HEIGHT=10pt VALUE=NONE LINE=1WIDTH=2 CV = _STYLE_ ;

Axis1 order = 0 to 10 STYLE=1 WIDTH=1 MINOR=NONE
    REFLABEL = 
      ( j=c color=RED height=4 "HELLO"     /* labels for two reference lines */
        j=l color=BLUE height=3 "EIGHT"  
      );
Axis2 STYLE=1 WIDTH=1 MINOR=NONE ;

TITLE;
TITLE1 "Bootstrap: Needle Plot of log salary";

options mprint;

DATA anno;
   %annomac;
   when = 'After';
   %system (1,2,4)
   %line (0,1, 100,1, GREEN, 0, 6)
   %label (30, 1.2, "LABEL AFTER", GREEN, 0, 0, 4, , B)
/* %LABEL (x, y, text-string, color, angle, rotate, size, style, position); */
RUN;

PROC GPLOT 
    DATA = sashelp.baseball(obs=20)
    ANNO = anno
    ;
    PLOT logsalary * name /
        VAXIS = AXIS1
        HAXIS = AXIS2

           VREF = ( 4  8 )         /* axial data value of reference lines */
          WVREF = ( 4  6 )         /* Width and colors of reference lines */
          CVREF = ( RED BLUE )
    ;
run;quit;
于 2019-03-19T22:32:48.853 回答