BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
davehalltwp
Quartz | Level 8

I just finished converting my program to use SGPLOT rather than GPLOT to do this plot.  What a relief!

 

There's one last thing that I have not yet figured out yet.  The vertical bars that mark the lower and upper standard error at each timepoint come out black.  I am able to customize the color of everything else.  Is there a way to do that?  I found a long list of __ATTRS in the documentation, but not sure if any of them apply to this horizontal bar.

 

I followed the example from here (you can see the horizontal bar in the "results" tab):

http://support.sas.com/kb/42/542.html

 

And then added on in my program:

 

proc sgplot data = adttr4; 
	 ** -- Uberdrug -- **;
     scatter x=avisitn y=mean1 / name = "scatter1" yerrorlower=lower1                                                                                            
                              yerrorupper=upper1                                                                                            
                              markerattrs=(color=green symbol=CircleFilled);                                                                
     series x=avisitn y=mean1  /  lineattrs=(color=green pattern=1);                                                                             
 
	 ** -- Placebo ----- **;
     scatter x=avisitn y=mean2 / name = "scatter2" yerrorlower=lower2                                                                                            
                              yerrorupper=upper2                                                                                            
                              markerattrs=(color=blue symbol=CircleFilled);                                                                
     series x=avisitn y=mean2 / lineattrs=(color=blue pattern=2);                                                                             

     xaxis values        = (28 91 183 274 365) 
		   valuesdisplay = ('Day 28 Pre-dose' 'Month 3' 'Month6' 'Month 9' 'Month 12')
           label = 'Timepoint' 
           labelattrs    = (family = "courier new" size = 8.9 pt color = black)
           offsetmin = .09 offsetmax = .09;
 
     yaxis values = (27 28 29 30 31 32)
           label = 'Mean Serum TTR (mg/dL) +/- 1 Standard Error' 
           labelattrs    = (family = "courier new" size = 8.9 pt color = black);

     legenditem type=marker name = "A" /
		        markerattrs=(color=green symbol=CircleFilled)
		        label="Uberdrug"
			    lineattrs=GraphData1
			    markerattrs=Graphdata1;
     legenditem type=marker name = "P" /
		        markerattrs=(color=blue symbol=CircleFilled)
		        label="Placebo"
			    lineattrs=GraphData1
				markerattrs=Graphdata1;
		   keylegend "A" "P" / title = "Treatment";
     run;  

Thank you in advance...

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

The ERRORBARATTRS option on the SCATTER plot should give you what you need.

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

The ERRORBARATTRS option on the SCATTER plot should give you what you need.

davehalltwp
Quartz | Level 8

Wow!  I didn't notice that one.  Thank you so much.  I will fix and then mark your reply as the solution.

 

Thank you...

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 977 views
  • 1 like
  • 2 in conversation