BookmarkSubscribeRSS Feed
Cingchih
Quartz | Level 8
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.

Image 003.png

It still can't solve the problem by using the VALUEATTRS= option (see here).  

gradlegend "scatter"/ valueattrs=(size=16);

Thanks.

 

Image 004.png

 

 

1 REPLY 1
RichardDeVen
Barite | Level 11

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:

  • SCATTERPLOT, and
  • CONTINUOUSLEGEND

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

RichardADeVenezia_0-1586412560545.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 894 views
  • 0 likes
  • 2 in conversation