BookmarkSubscribeRSS Feed
MJ1985
Fluorite | Level 6

Capture.PNG

proc sgplot data=glimpred;
scatter x=predMu y=BW / coloresponse=studentMu  markerattrs=(symbol=CircleFilled size=7) filledoutlinedmarkers colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F) ;
ellipse x=predMu y=BW / lineattrs=(COLOR=grey PATTERN=2 THICKNESS=0.5);
lineparm x=0 y=0 slope=1 / LINEATTRS=(COLOR=black PATTERN=2 THICKNESS=1);
title 'Observed vs Predicted - Total';
run;
6 REPLIES 6
ballardw
Super User

You should provide some description of what you are attempting and possibly data in form of a dataset to test code against.

 

Colorresponse works with the Gradlegend statement so you need to add Gradlegend.

 

Or perhaps you want your StuendMu variable to be a group variable.

 

MJ1985
Fluorite | Level 6

No data necessary - you can see that the markers are colored according to the color response model but that the legend is not. This code used to work fine in the SAS studio version that comes with SAS base, but it does not work anymore on the SAS server solution unfortunately. 

Reeza
Super User

@MJ1985 wrote:

 This code used to work fine in the SAS studio version that comes with SAS base, but it does not work anymore on the SAS server solution unfortunately. 


Are they the same version of SAS, exactly? 

What is the default style in each version?

 


@MJ1985 wrote:

No data necessary - you can see that the markers are colored according to the color response model but that the legend is not.

 

Well, yes, but you posted a graph and a title and no question so we have no idea of what you actually want. Data helps to replicate your issue, but you're right, that's not necessary. 

DanH_sas
SAS Super FREQ

Try this and see if you get what you want:

 

proc sgplot data=glimpred;
scatter x=predMu y=BW / coloresponse=studentMu  markerattrs=(symbol=CircleFilled size=7) filledoutlinedmarkers colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F) name="BW" ;
ellipse x=predMu y=BW / lineattrs=(COLOR=grey PATTERN=2 THICKNESS=0.5);
lineparm x=0 y=0 slope=1 / LINEATTRS=(COLOR=black PATTERN=2 THICKNESS=1);
gradlegend "BW";
title 'Observed vs Predicted - Total';
run;
MJ1985
Fluorite | Level 6

Hi, tried and not working. I am now almost thinking of what Rick has told that It may be a configuration thing - the imagemap is working in SAS base as is the colorresponse (that is why i first used the code) but it not working in sas studio 3.6

Rick_SAS
SAS Super FREQ

> This code used to work fine in the SAS studio version that comes with SAS base, but it does not work anymore on the SAS server solution unfortunately. 

 

The OP has used this same sentence for two posts about "graphs not working." It would be helpful to know the previous and current configurations. Can anyone explain what is meant by this sentence? 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 6 replies
  • 1170 views
  • 2 likes
  • 5 in conversation