【问题标题】:Superscript negative exponent lable on axis in SAS Proc SGPLOTSAS Proc SGPLOT中轴上的上标负指数标签
【发布时间】:2016-04-12 05:24:43
【问题描述】:

谁能帮我在 x 轴上正确添加上标 -1 吗?下面的代码是我根据其他搜索尝试过的。但是,结果图有一个方框,应该是负号。有人对为什么会发生这种情况有任何想法吗?提前谢谢你。

ods escapechar='~';

proc sgplot data=fig2;
series x=hour y=SB /legendlabel='SB' MARKERS LINEATTRS = (THICKNESS = 1 pattern=solid) MARKERATTRS=(SYMBOL=DIAMOND);
series x=hour y=LPA /legendlabel='LPA' MARKERS LINEATTRS = (THICKNESS = 1 pattern=solid) MARKERATTRS=(SYMBOL=PLUS);
series x=hour y=MPA /legendlabel='MPA' MARKERS LINEATTRS = (THICKNESS = 1 pattern=solid) MARKERATTRS=(SYMBOL=CIRCLE);
series x=hour y=MVPA /legendlabel='MVPA' MARKERS LINEATTRS = (THICKNESS = 1 pattern=solid) MARKERATTRS=(SYMBOL=TRIANGLE);
series x=hour y=VPA /legendlabel='VPA' MARKERS LINEATTRS = (THICKNESS = 1 pattern=solid) MARKERATTRS=(SYMBOL=SQUARE);
yaxis label= "Absolute Percent Error (%)" ;
**xaxis label= "Wear Time hours·day ~{unicode'207b'x}~{unicode'00b9'x}"** type=discrete ;
keylegend /position=right NOBORDER;
run;

【问题讨论】:

    标签: unicode sas axis-labels


    【解决方案1】:

    这很可能是因为您的模板中的字体不支持 Unicode 字符。您需要修改模板。

    请参阅此处以获取带有 PROC SGRENDER http://support.sas.com/kb/49/694.html 的 Unicode 示例

    因此,为了适合您的示例,首先定义新样式:

    proc template;
       define style unifonts;   
       parent=Styles.meadow;
       style Graphfonts from GraphFonts /
          'GraphValueFont' = ("Monotype Sans WT J",12pt)
          'GraphLabelFont' = ("Monotype Sans WT J",12pt)
          'GraphDataFont' = ("Monotype Sans WT J",12pt)
          'GraphTitleFont' = ("Monotype Sans WT J",12pt)
          'GraphFootnoteFont'=("Monotype Sans WT J",12pt)
          'GraphAnnoFont'=("Monotype Sans WT J",12pt);
       end;
    run; 
    

    然后使用该样式并运行您的图表

    ods html style=unifonts ;
    <your code here>
    

    另请参阅指导您更改图形样式的文档http://support.sas.com/documentation/cdl/en/grstatug/67914/HTML/default/viewer.htm#n1sj0165otoa5cn1jr451nhq0sjc.htm

    【讨论】:

    • 谢谢,就是这样!感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多