proc sgplot data=sashelp.gridded(where=(count>0));
scatter x=height y=weight /
colorresponse=density name="scatter"
markerattrs=(symbol=squarefilled size=6px);
gradlegend "scatter" ;
run;
Hi all,
I wanted to enlarge the word in the gradlegend.
It still can't solve the problem by using the VALUEATTRS= option (see here).
gradlegend "scatter"/ valueattrs=(size=16);
Thanks.
The SGPLOT "GRADLEGEND Statement" documentation has a link to "Optional arguments" The link incorrectly takes you to the optional arguments of the "KEYLEGEND Statement".
The SGPLOT GRADLEGEND Statement does not support the / VALUEATTRS= option. This could be a development oversight, or by choice -- who knows ?
The SGPLOT statements are interfaces that surface the very wide capabilities of the Graphics Template Language (GTL) and there are places such as this where some GTL functionality is NOT surfaced.
In your situation, you can drop down to GTL and write template code that SGRENDER uses to produce the same plot AND supports changing the size of legend values. The important GTL statements you will use are:
Example:
proc template; define statgraph gridly; begingraph; layout overlay; scatterplot X=Height Y=Weight / colorresponse=density markerattrs=(symbol=squarefilled size=6px) name="sp" ; continuouslegend "sp" / valueattrs=(size=16pt) /* Larger font size for legend values */ ; endlayout; endgraph; end; run; proc sgrender data=sashelp.gridded template=gridly; where count > 0; run;
Output
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.