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

I'm using proc sgplot and I would like a dark solid line over a fairly transparent scatter plot. Can I adjust the transparency for the line/markers individually? 

It seems you that you can't put 'transparency' inside either set of parentheses. 

 

 

 

proc sgplot data=mydata; 
	reg y=hrs x=days / lineattrs=(thickness=4 color=red)
		markerattrs=(symbol=circlefilled size=6) transparency=0.85; 
	yaxis grid values=(0 to 1800 by 100) label="ylabel";
	xaxis label="xlabel";
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

I might suggest two REG statements. One with the markers and transparency you want , the second with the line attributes you want and the NOMARKERS option.

 

The order of the REG statements will have some impact so I suspect the first should be the one with markers and the second the one without markers so the line draws over the previous line.

View solution in original post

2 REPLIES 2
ballardw
Super User

I might suggest two REG statements. One with the markers and transparency you want , the second with the line attributes you want and the NOMARKERS option.

 

The order of the REG statements will have some impact so I suspect the first should be the one with markers and the second the one without markers so the line draws over the previous line.

Ksharp
Super User

You could overlap scatter points or line to make it happen.

 

proc sgplot data=sashelp.heart; 
	scatter y=height x=weight/markerattrs=(symbol=circlefilled size=6) transparency=0.85;
    reg y=height x=weight / lineattrs=(thickness=4 color=red ) nomarkers; 
	yaxis grid  label="ylabel";
	xaxis label="xlabel";
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
  • 2 replies
  • 1625 views
  • 2 likes
  • 3 in conversation