<?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: Formatting and exporting graphs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/883711#M349141</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*the path/folder to store the graph And image_dpi=300  make better quality graph;
ods listing gpath='c:\temp' image_dpi=300 ;  
ods graphics/outputfmt=png imagename='want';
proc sgplot data=sashelp.class;
scatter x=weight y=height/group=sex datalabel=name;
keylegend /location=inside position=nw valueattrs=(size=30) titleattrs=(size=30);
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-1688646879696.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85589i3A59275DE0116991/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1688646879696.png" alt="Ksharp_0-1688646879696.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1688646914212.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85590i333B9A93ADAED1B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1688646914212.png" alt="Ksharp_1-1688646914212.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2023 12:35:07 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-07-06T12:35:07Z</dc:date>
    <item>
      <title>Formatting and exporting graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/883705#M349139</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am currenly transferring my results into graphs with SAS, but I am struggling with formatting and exporting them in a way they are readable in a document. I have following command to create the graphs (not mine, got it from a template):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=mydata noautolegend;
band x=date upper=band1_u lower=band1_l / noextend;
band x=date upper=band2_u lower=band2_l / noextend;
scatter x=date y=yvalues /  markerattrs=(symbol=circlefilled color=CX203554 size=4) name="Observed rate";
series x=date y=modeled1 / lineattrs=(pattern=solid color=CX536582 thickness=2) name="Modeled trend";
series x=date y=modeled2 / lineattrs=(pattern=solid color=CX536582 thickness=2) name="none";
series x=date y=projection / lineattrs=(pattern=shortdash color=/*CX536582*/black thickness=2) name="Predicted trend";

yaxis label="Y Axis" values=(0 to 15000 by 1500) labelattrs=(size=15) valueattrs=(size=13);
xaxis label="Timeline" labelattrs=(size=18) valueattrs=(size=13) interval=month;
refline '1Jan2015'd '1Jan2016'd '1Jan2017'd '1Jan2018'd '1Jan2019'd '1Jan2020'd '1Jan2021'd / axis=x;
keylegend "Observed proportion" "Modeled trend"  "Predicted trend" / location=inside position=topright across=1 opaque;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This leads to following graph:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot_SAS.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85588iD085AB0F45A1DEE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot_SAS.png" alt="SGPlot_SAS.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. How can I adjust the letter size of "Modeled trend" and "Predicted trend"? They are barely readable when putting them in a document.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. How can I export the graph afterwards directly from SAS into a folder in good quality (.jpeg, .pdf or else)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Maybe any other suggestions to nicely display the graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/883705#M349139</guid>
      <dc:creator>Tamino</dc:creator>
      <dc:date>2023-07-06T12:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting and exporting graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/883711#M349141</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*the path/folder to store the graph And image_dpi=300  make better quality graph;
ods listing gpath='c:\temp' image_dpi=300 ;  
ods graphics/outputfmt=png imagename='want';
proc sgplot data=sashelp.class;
scatter x=weight y=height/group=sex datalabel=name;
keylegend /location=inside position=nw valueattrs=(size=30) titleattrs=(size=30);
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-1688646879696.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85589i3A59275DE0116991/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1688646879696.png" alt="Ksharp_0-1688646879696.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1688646914212.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85590i333B9A93ADAED1B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1688646914212.png" alt="Ksharp_1-1688646914212.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/883711#M349141</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-06T12:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting and exporting graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884313#M349348</link>
      <description>&lt;P&gt;Thank you, the export works with this command. But actually the saved image looks different as displayed in SAS sometimes. For example the labeling of the x-axis is not the same in SAS and in the saved image.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 11:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884313#M349348</guid>
      <dc:creator>Tamino</dc:creator>
      <dc:date>2023-07-11T11:44:55Z</dc:date>
    </item>
    <item>
      <title>Formatting sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884318#M349356</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am currenly transferring my results into graphs with SAS, but I am struggling with formatting them in a way they are readable in a document. I have following command to create the graphs (not mine, got it from a template):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc sgplot data=mydata noautolegend;
band x=date upper=band1_u lower=band1_l / noextend;
band x=date upper=band2_u lower=band2_l / noextend;
scatter x=date y=yvalues /  markerattrs=(symbol=circlefilled color=CX203554 size=4) name="Observed rate";
series x=date y=modeled1 / lineattrs=(pattern=solid color=CX536582 thickness=2) name="Modeled trend";
series x=date y=modeled2 / lineattrs=(pattern=solid color=CX536582 thickness=2) name="none";
series x=date y=projection / lineattrs=(pattern=shortdash color=/*CX536582*/black thickness=2) name="Predicted trend";

yaxis label="Y Axis" values=(0 to 15000 by 1500) labelattrs=(size=15) valueattrs=(size=13);
xaxis label="Timeline" labelattrs=(size=18) valueattrs=(size=13) interval=month;
refline '1Jan2015'd '1Jan2016'd '1Jan2017'd '1Jan2018'd '1Jan2019'd '1Jan2020'd '1Jan2021'd / axis=x;
keylegend "Observed proportion" "Modeled trend"  "Predicted trend" / location=inside position=topright across=1 opaque;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This leads to following graph:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tamino_0-1689076104771.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85717iB7E3281C2E2B7E56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tamino_0-1689076104771.png" alt="Tamino_0-1689076104771.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;1. How can I adjust the letter size of "Modeled trend" and "Predicted trend"? They are barely readable when putting them in a document.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. How can I rotate the labelling of the x-axis 45 degrees (from bottom left to up right)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Maybe any other suggestions to nicely display the graph?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 11:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884318#M349356</guid>
      <dc:creator>Tamino</dc:creator>
      <dc:date>2023-07-11T11:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting and exporting graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884321#M349353</link>
      <description>Then post your code and dataset and picture to illustrate your problem ?</description>
      <pubDate>Tue, 11 Jul 2023 11:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884321#M349353</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-11T11:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting sgplot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884325#M349357</link>
      <description>&lt;P&gt;Here is for your second question.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
scatter x=weight y=height/group=sex datalabel=name;
keylegend /location=inside position=nw valueattrs=(size=30) titleattrs=(size=30);

xaxis fitpolicy=rotatealways valuesrotate=DIAGONAL2;
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-1689077516522.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85718i577874F4EF025C5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1689077516522.png" alt="Ksharp_0-1689077516522.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 12:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884325#M349357</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-11T12:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting and exporting graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884375#M349387</link>
      <description>&lt;P&gt;Some generic comments about output and documents.&lt;/P&gt;
&lt;P&gt;First thing is the ODS Style in effect. When you use ODS to different destinations, such as RTF or PDF then the ODS STYLE used by default may well differ from the typical results window results. So you may want to specify the STYLE= option on the ODS destination statement to make sure that it is using the same setting for output as you used when creating the graphs. Otherwise colors, marker types, and even line settings may change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some of your ODS destinations such as RTF and PDF will honor a PAPERSIZE option to create custom size display areas. Otherwise they default to your system page defaults.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS RTF also has options GTITLE/NOGTITLE and GFOOTNOTE/NOGFOOTNOTE. If want to use word processor tools to include the titles and/or footnotes that may appear in graphs as part of a list of figures or such then you may want to specify the NOGTITLE/NOGFOOTNOTE option to make them part of the RTF output instead of in the graph image.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS Graphics options let you change the height/width of the graph display area but if you specify a size that the ODS destination can't currently use because it won't fit on the logical paper size then results are problematic. Additionally the ODS Graphics may scale fonts to fit a custom image size that can make them larger/smaller than desired. So you may want to investigate behavior of SCALE/NOSCALE on ODS Graphics with your particular graphs.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 17:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-and-exporting-graphs/m-p/884375#M349387</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-07-11T17:26:13Z</dc:date>
    </item>
  </channel>
</rss>

