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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 6 replies
  • 1578 views
  • 2 likes
  • 5 in conversation