<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing the text weight for 1 of 2 legend labels in Proc SGPLOT- SAS 9.4 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953485#M372498</link>
    <description>&lt;P&gt;You could customize legend by LEGENDITE statement to make it happen.&lt;/P&gt;
&lt;P&gt;But make sure the item of legend is consistent/same within GRAPH (you can PROC SORT it before).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set sashelp.heart(obs=1000);
run;

proc sort data=have ;by sex ;run;
proc sgplot data=have;
scatter x=weight y=height/group=sex ;
legenditem name='a' type=MARKERLINE / label='Female' labelattrs=(weight=bold) MARKERATTRS=(symbol=circlefilled color= blue) LINEATTRS=(color= blue);
legenditem name='b' type=MARKERLINE / label='Male' MARKERATTRS=(symbol=circlefilled color= red) LINEATTRS=(color= red);
keylegend 'a' 'b'/title='Sex:';
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1734058871305.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/102995iFF6920EA918A6DCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1734058871305.png" alt="Ksharp_0-1734058871305.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2024 03:01:20 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-12-13T03:01:20Z</dc:date>
    <item>
      <title>Changing the text weight for 1 of 2 legend labels in Proc SGPLOT- SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953410#M372483</link>
      <description>&lt;P&gt;I want to bold one of the legend labels in my proc sgplot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my current results, highlighted is what I want in bold ("A"):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/102966iA9324D3CE438308D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=final noborder ;  

series x=date y=&amp;amp;y1/ datalabel=&amp;amp;y1 DATALABELATTRS=(family='Roboto' SIZE=10pt weight=bold color=black)DATALABELPOS=top
MARKERS MARKERATTRS=(SYMBOL=CircleFilled color=red size=8) LINEATTRS = (color=red pattern=solid THICKNESS=3) legendlabel= "A" ;

series x=date y=&amp;amp;y2 / datalabel=&amp;amp;y2 DATALABELATTRS=(family='Roboto' SIZE=10pt color=black)DATALABELPOS=bottom
MARKERS MARKERATTRS=(SYMBOL=CircleFilled color=blue size=8) LINEATTRS = (color=blue pattern=solid THICKNESS=3) legendlabel= "B";

yaxis  grid VALUES = (&amp;amp;values) display=(noline noticks) valueATTRS=(family='Roboto' size=10pt)
label=" " LABELATTRS=(family='Roboto' size=10pt);

XAXIS TYPE = LINEAR  display=( noline noticks)label=" "
LABELATTRS=(family='Roboto' size=10pt ) valueATTRS=(family='Roboto' size=10pt ) ;

keylegend / noborder location=outside position=bottom valueATTRS=(family='Roboto' size=10pt)  ;
title &amp;amp;TITLE1 ;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 16:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953410#M372483</guid>
      <dc:creator>Whitlea</dc:creator>
      <dc:date>2024-12-12T16:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the text weight for 1 of 2 legend labels in Proc SGPLOT- SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953415#M372485</link>
      <description>&lt;P&gt;To apply different legend appearance to different plots the steps are:&lt;/P&gt;
&lt;P&gt;1) Provide a name to each plot you want to appear&lt;/P&gt;
&lt;P&gt;2) Provide a different Keylegend statement referencing the name with the attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example that sets one legend with green for the value text in bold text.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class;
   scatter x=age y=height/name='h' ;
   scatter x=age y=weight/name='w' ;
   keylegend 'h'/ position=bottom  valueattrs=(color=green weight=bold);
   keylegend 'w'/  position=bottom  ;
run;&lt;/PRE&gt;
&lt;P&gt;You do have to provide the second (or other) keylegend statements otherwise the names not references will not appear in the legend. There will be some interaction between positions and such to play with&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 17:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953415#M372485</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-12-12T17:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the text weight for 1 of 2 legend labels in Proc SGPLOT- SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953485#M372498</link>
      <description>&lt;P&gt;You could customize legend by LEGENDITE statement to make it happen.&lt;/P&gt;
&lt;P&gt;But make sure the item of legend is consistent/same within GRAPH (you can PROC SORT it before).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set sashelp.heart(obs=1000);
run;

proc sort data=have ;by sex ;run;
proc sgplot data=have;
scatter x=weight y=height/group=sex ;
legenditem name='a' type=MARKERLINE / label='Female' labelattrs=(weight=bold) MARKERATTRS=(symbol=circlefilled color= blue) LINEATTRS=(color= blue);
legenditem name='b' type=MARKERLINE / label='Male' MARKERATTRS=(symbol=circlefilled color= red) LINEATTRS=(color= red);
keylegend 'a' 'b'/title='Sex:';
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1734058871305.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/102995iFF6920EA918A6DCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1734058871305.png" alt="Ksharp_0-1734058871305.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 03:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-text-weight-for-1-of-2-legend-labels-in-Proc-SGPLOT/m-p/953485#M372498</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-13T03:01:20Z</dc:date>
    </item>
  </channel>
</rss>

