SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Barkamih
Pyrite | Level 9

Hi Guys,

 

I'm using  the following code for my data to preset 4 groups in one graph, as you see this code can do what I'm looking for but the only issue is that I couldn't make the line graphs in different looking such as, continues dots, not continues line or whatever any differentiation to make line different for each group.

 

by default, these graphs are in different colours, but different colures do not work for black and white printing.    

 

I'll be happy for your help 

 

Barkamih


proc nlin data = milkno method = marquardt;
parms A = 15 B = -0.19 C = 0.0012 ;
by pr ;
model TEST_DAY_milk_kg = A * Time **b * exp(-C*Time);
output out = Fit predicted = pred ;
symbol1 interpol= join value = star color= black;
symbol2 interpol = none value = none color = red;
run;
QUIT;

proc sort data=fit;
by time;
RUN;

proc sgplot data=fit;
series y=pred x=time / group=pr;
xaxis values=(1 to 12 by 1);
yaxis values=(0 to 40 by 5);

run;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

With PROC SGPLOT, you need the ATTRPRIORITY=NONE option and the STYLEATTRS statement. Example:

ods graphics/attrpriority=none;
proc sgplot data=sashelp.stocks(where=(stock='IBM' or stock='Microsoft'));
	styleattrs datacontrastcolors=(black black) datalinepatterns=(dot solid);
	series x=date y=open/group=stock ;
run;

The list of line patterns is here: https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=grstatproc&docsetTarget=p...

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

With PROC SGPLOT, you need the ATTRPRIORITY=NONE option and the STYLEATTRS statement. Example:

ods graphics/attrpriority=none;
proc sgplot data=sashelp.stocks(where=(stock='IBM' or stock='Microsoft'));
	styleattrs datacontrastcolors=(black black) datalinepatterns=(dot solid);
	series x=date y=open/group=stock ;
run;

The list of line patterns is here: https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=grstatproc&docsetTarget=p...

--
Paige Miller
Barkamih
Pyrite | Level 9

Thanks million 

It works perfectly 

Regards 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1349 views
  • 1 like
  • 2 in conversation