<?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 color of text of individual x-axis tick labels in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974147#M377819</link>
    <description>&lt;P&gt;Hi did&amp;nbsp; you wanted to achieve something like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph MyGraphTemplate;
    begingraph;
      layout overlay / 
           xaxisopts=(label="X Axis Label" labelattrs=(color=blue size=12pt))
           yaxisopts=(label="Y Axis Label" labelattrs=(color=red size=12pt));
        scatterplot x=weight y=height;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.class template=MyGraphTemplate;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 902px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109620i9296FE5D510B30B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more on this please see the below link&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Creating and Customizing Graphics using Graph Template Language" href="https://pharmasug.org/proceedings/2018/EP/PharmaSUG-2018-EP17.pdf" target="_self"&gt;Creating and Customizing Graphics using Graph Template Language&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Sep 2025 19:42:44 GMT</pubDate>
    <dc:creator>himself</dc:creator>
    <dc:date>2025-09-04T19:42:44Z</dc:date>
    <item>
      <title>Changing the color of text of individual x-axis tick labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974120#M377804</link>
      <description>&lt;P&gt;&amp;nbsp;I'm trying to apply different colors to the text of individual tick mark values.&amp;nbsp; Below is an example of code I tried; also tried&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;valueattrs = (color = red color= green color = blue);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;which didn't work either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data a;
District = 'D1'; score = 6; output;
District = 'D2'; score = 6; output;
District = 'D3'; score = 6; output;
run;

proc sgplot data=a;
 hbar District/response=score;
yAXIS 
values=('D1' 'D2' 'D3') 
valueattrs = (color = red green blue);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Sep 2025 13:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974120#M377804</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2025-09-04T13:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the color of text of individual x-axis tick labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974147#M377819</link>
      <description>&lt;P&gt;Hi did&amp;nbsp; you wanted to achieve something like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph MyGraphTemplate;
    begingraph;
      layout overlay / 
           xaxisopts=(label="X Axis Label" labelattrs=(color=blue size=12pt))
           yaxisopts=(label="Y Axis Label" labelattrs=(color=red size=12pt));
        scatterplot x=weight y=height;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.class template=MyGraphTemplate;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 902px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109620i9296FE5D510B30B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more on this please see the below link&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Creating and Customizing Graphics using Graph Template Language" href="https://pharmasug.org/proceedings/2018/EP/PharmaSUG-2018-EP17.pdf" target="_self"&gt;Creating and Customizing Graphics using Graph Template Language&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974147#M377819</guid>
      <dc:creator>himself</dc:creator>
      <dc:date>2025-09-04T19:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the color of text of individual x-axis tick labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974157#M377824</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not the LABEL, but thank you for the suggestion.&amp;nbsp; I'm trying to apply different colors to the &lt;STRONG&gt;axis tick mark values&lt;/STRONG&gt; - in the example, the text D1, D2, and D3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot412.png" style="width: 432px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109624iAF1EE1D639F4C8DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot412.png" alt="SGPlot412.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974157#M377824</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2025-09-04T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the color of text of individual x-axis tick labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974197#M377835</link>
      <description>&lt;P&gt;You could use YAXISTABLE statement to simulate the tick value of Y axis .&lt;/P&gt;
&lt;P&gt;Check this post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Customize-fonts-using-attribute-map/m-p/972511#M25621" target="_blank"&gt;https://communities.sas.com/t5/Graphics-Programming/Customize-fonts-using-attribute-map/m-p/972511#M25621&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dattrmap;
infile cards truncover;
input id $ value $  textcolor $;
datalines;
code   D1      red  
code   D2    green
code   D3     blue
;



data a;
District = 'D1'; score = 6; output;
District = 'D2'; score = 6; output;
District = 'D3'; score = 6; output;
run;

proc sgplot data=a dattrmap=dattrmap ;
 hbarparm category=District response=score;
xaxis display=(nolabel) ;
yaxis display=(nolabel novalues)  ;

yaxistable  District/nolabel y=District  valueattrs=(size=10pt) position=left  textgroup=District textgroupid=code;
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-1757056841320.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109642iCE46A1D90A4139B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1757056841320.png" alt="Ksharp_0-1757056841320.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 07:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974197#M377835</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-09-05T07:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the color of text of individual x-axis tick labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974294#M377874</link>
      <description>didn't think of the "position=left" - thanks!</description>
      <pubDate>Fri, 05 Sep 2025 19:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-color-of-text-of-individual-x-axis-tick-labels/m-p/974294#M377874</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2025-09-05T19:55:37Z</dc:date>
    </item>
  </channel>
</rss>

