proc sgplot多行标题

时间:2017-06-30 04:05:44

标签: sas sgplot

如何拥有多行图表的标题?我想在第一行中有标题,然后在该标题下面的一个段落来解释图形。 我的尝试是:

proc sgplot data= maindata.small_medium_big_firms;
    title "Number of big, medium and small firms" 
    title1 " this is to explain the graph .........";
    series x=year y=group_1/lineattrs=(color=red) legendlabel= "small";
    series x=year y=group_2/lineattrs=(color=blue) legendlabel= "medium";
    series x=year y=group_3/lineattrs=(color=black) legendlabel= "big";
    YAXIS LABEL = 'Number of firms';
    XAXIS LABEL = 'Year';
run;

1 个答案:

答案 0 :(得分:2)

Title和Title1是相同的命令。按照设计,如果您提交新的TITLE语句,它将覆盖任何其他具有相同数字和更高编号的TITLE语句。

http://support.sas.com/documentation/cdl/en/grstatproc/69716/HTML/default/viewer.htm#n1ukd9sqgqiwwhn1mrx4c1rbse1j.htm

这使用SASHELP数据集运行,因此任何拥有SAS的人都应该能够正确运行代码。

proc sgplot data= sashelp.stocks;
    title1 "My Title - Title1" ;
    title2 "Other Text - title2";

    where stock='IBM';
    series x=date y=open/lineattrs=(color=red) legendlabel= "Open";
    series x=date y=close/lineattrs=(color=blue) legendlabel= "Close";
    series x=date y=high/lineattrs=(color=black) legendlabel= "High";
    YAXIS LABEL = 'Stock Price';
    XAXIS LABEL = 'Date';
run;