<?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: How to change font in a plot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752266#M21720</link>
    <description>&lt;P&gt;Another option would be to use the older SAS/Graph proc gplot, where you can control the text font with "goptions ftext=".&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jul 2021 11:47:38 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2021-07-06T11:47:38Z</dc:date>
    <item>
      <title>How to change font in a plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/751407#M21711</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It seems a very easy question but somehow I am struggling with this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I just want to change the FONT (not font size, this I can do easily) of all text in a plot (in SGPLOT): axis labels and values, legend items...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I guess I have to define a new style, something like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define style my_style;
parent=styles.htmlblue;
class GraphValueText / font = ("&amp;lt;sans-serif&amp;gt;, &amp;lt;MTsans-serif&amp;gt;",20pt);
end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;How can I set the font to Times New Roman, or Arial, etc, instead of sans-serif?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Where can I find a list of available fonts?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And how do I apply the new style to the plot?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could someone give an example (as easy as possible)?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 07:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/751407#M21711</guid>
      <dc:creator>marta25</dc:creator>
      <dc:date>2021-07-01T07:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change font in a plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/751597#M21715</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example of how to use different fonts. GraphLabelFont controls the axis labels and the legend label. GraphValueFont controls the axis tick values, and the values within the legend. Also, make sure that you actually look at the graph file that is being outputted, i.e. the .PNG file on your C drive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc template;
  define style styles.new_font;
  parent = styles.default;
  class GraphFonts
      "Fonts used in graph styles" /
      'GraphValueFont' = ("Arial",9pt)
      'GraphLabelFont' = ("Times New Roman Uni",10pt,
      bold);
  end;
run;


ods listing style = styles.new_font gpath = "C:\graph";
proc sgplot data=sashelp.class;
  scatter x=height y=weight / group=sex;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 00:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/751597#M21715</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-07-02T00:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to change font in a plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/751600#M21716</link>
      <description>&lt;P&gt;Also, this link can show you how to find which fonts are available:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/graphref/n0840ghr9b9y3bn0zphem54hvgbt.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/graphref/n0840ghr9b9y3bn0zphem54hvgbt.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 00:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/751600#M21716</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-07-02T00:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to change font in a plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752266#M21720</link>
      <description>&lt;P&gt;Another option would be to use the older SAS/Graph proc gplot, where you can control the text font with "goptions ftext=".&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 11:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752266#M21720</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-07-06T11:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change font in a plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752290#M21721</link>
      <description>Thanks, this is nice, however now the background fill of the plot is grey. How do I change this to white/transparent?</description>
      <pubDate>Tue, 06 Jul 2021 13:02:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752290#M21721</guid>
      <dc:creator>marta25</dc:creator>
      <dc:date>2021-07-06T13:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to change font in a plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752448#M21725</link>
      <description>&lt;P&gt;You're welcome. You can add the GraphBackground class to change the fill color from grey to white, as seen below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc template;
  define style styles.new_font;
  parent = styles.default;

  class GraphBackground /
      color = white;

  class GraphFonts
      "Fonts used in graph styles" /
      'GraphValueFont' = ("Arial",9pt)
      'GraphLabelFont' = ("Times New Roman Uni",10pt,
      bold);
  end;
run;


ods listing style = styles.new_font gpath = "C:\graph";
proc sgplot data=sashelp.class;
  scatter x=height y=weight / group=sex;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Jul 2021 22:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-font-in-a-plot/m-p/752448#M21725</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-07-06T22:00:43Z</dc:date>
    </item>
  </channel>
</rss>

