0
votes

How can have a title of a graph with multiple lines? I would like to have to title in the first line and then a paragraph underneath that title to explain the graph. My attempt is:

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
Try title1 and title2Reeza
I tried title1 and it only takes the value of title 1 and ignores titleduckman
Which is why you need title1 and title2. Title is the same as title1 and it overwrites it.Reeza

1 Answers

2
votes

Title and Title1 are the same command. By design, if you submit a new TITLE statement it overwrites any other TITLE statements of the same number and higher numbers.

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

This uses SASHELP data set to run, so anyone with SAS should be able to run the code correctly.

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;