BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ballardw
Super User

Another approach may be to not create multiple variables to plot but add an indicator variable as to source/purpose/whatever and use SGPANEL to create one graph panel for each value of the Panelby variable(s).

data temp;
do x=1 to 20;
y1=ranuni(1);
y2=10*ranuni(2);
y3=100*ranuni(3);
y4=1000*ranuni(4);
output;
end;
run;

data toplot;
   set temp;
   array ys(*) y:;
   do i=1 to dim(ys);
      var=vname(ys[i]);
      value=ys[i];
      output;
   end;
   keep x var value;
run;

proc sgpanel data=toplot;
   panelby var /columns=2 rows=2 
                onepanel uniscale=column
   ;
   scatter x=x y=value;
run;

Or SGPLOT and group to overlay

proc sgplot data=toplot;
   ;
   scatter x=x y=value/group=var;
run;

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 15 replies
  • 1738 views
  • 1 like
  • 4 in conversation