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 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 25. 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
  • 2 replies
  • 857 views
  • 1 like
  • 2 in conversation