BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
yuwentaiwan
Calcite | Level 5

EXCEL.png

This photo is plot by excel.

How can I make like this by sas?

I try many times but failed!

thanks!

 

data a17;
input  year a1-a9;
cards;
104 4 2 3	2 11 7 3 0 1
105 2 0 4	1 12 6 3 0 0
106 5 2 5	2 8 4 5 1 0
107 3 2 3	1 20 6 3 1 0
;
proc print;run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template

 

data a17;
input  year a1-a9;
cards;
104 4 2 3	2 11 7 3 0 1
105 2 0 4	1 12 6 3 0 0
106 5 2 5	2 8 4 5 1 0
107 3 2 3	1 20 6 3 1 0
;

proc transpose data=a17 out=plot(rename = (col1=a _NAME_=n));
   by year;
run;

proc sgplot data = plot;
   series x = n y = a / group= year lineattrs=(thickness=3);
   styleattrs datacontrastcolors=(blue orange grey gold);
   yaxis min = 0 max = 25 grid display=(nolabel);
   xaxis display=(nolabel);
run;

 

Result:

 

SGPlot10.png

 

View solution in original post

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template

 

data a17;
input  year a1-a9;
cards;
104 4 2 3	2 11 7 3 0 1
105 2 0 4	1 12 6 3 0 0
106 5 2 5	2 8 4 5 1 0
107 3 2 3	1 20 6 3 1 0
;

proc transpose data=a17 out=plot(rename = (col1=a _NAME_=n));
   by year;
run;

proc sgplot data = plot;
   series x = n y = a / group= year lineattrs=(thickness=3);
   styleattrs datacontrastcolors=(blue orange grey gold);
   yaxis min = 0 max = 25 grid display=(nolabel);
   xaxis display=(nolabel);
run;

 

Result:

 

SGPlot10.png

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 437 views
  • 1 like
  • 2 in conversation