0

如何拥有多条线的图形标题?我想在第一行加上标题,然后在该标题下方的一段来解释图表。我的尝试是:

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;
4

1 回答 1

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;
于 2017-07-03T00:32:27.607 回答