<?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 Background Image for Plots Generated with SGPLOT Macro in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812694#M22828</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am generating a series of plots using an SGPLOT macro and I have an image that I want to use for the background of all of the plots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I was making the plots one at a time without the macro the annotate function worked fine to add the image to the plot background.&lt;/P&gt;
&lt;P&gt;However, that does not work with the macro.&amp;nbsp; I suspect that I need to add an SG macro to the code to accomplish this.&lt;/P&gt;
&lt;P&gt;Can anyone provide me with the code that would accomplish that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%MACRO SGPLOT; %DO i=1 %TO &amp;amp;total;
 
ods listing style = map_symbols  gpath = '\\C:Macro Plots\Output Files' IMAGE_DPI=1200;
ODS GRAPHICS ON / imagename = 'NA Test Map' IMAGEFMT=png IMAGEMAP=on BORDER=off; OPTIONS NOBYLINE;

data annoimage; length function $10.; function = 'image'; height = 90; width = 100; drawspace = 'wallpercent';
image = '\\C:Analysis Files\Plot Background.jpg';
layer = 'back'; run;

PROC SGPLOT DATA=macrovar NOAUTOLEGEND NOCYCLEATTRS sganno =annoImage;
WHERE Site_Code="&amp;amp;&amp;amp;Site_Code&amp;amp;i";
TITLE;
YAXIS grid gridattrs = (color = black) display = (noline nolabel noticks novalues) values=(0 to 100 by 5);
XAXIS grid gridattrs = (color = black) display =(noline nolabel noticks novalues) values=(0 to 100 by 5);
SCATTER x = US_X y = US_Y/
 
ODS GRAPHICS OFF; ODS _ALL_ CLOSE; ODS LISTING CLOSE; %END; %MEND SGPLOT; %SGPLOT;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 May 2022 15:37:27 GMT</pubDate>
    <dc:creator>fastb</dc:creator>
    <dc:date>2022-05-11T15:37:27Z</dc:date>
    <item>
      <title>Background Image for Plots Generated with SGPLOT Macro</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812694#M22828</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am generating a series of plots using an SGPLOT macro and I have an image that I want to use for the background of all of the plots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I was making the plots one at a time without the macro the annotate function worked fine to add the image to the plot background.&lt;/P&gt;
&lt;P&gt;However, that does not work with the macro.&amp;nbsp; I suspect that I need to add an SG macro to the code to accomplish this.&lt;/P&gt;
&lt;P&gt;Can anyone provide me with the code that would accomplish that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%MACRO SGPLOT; %DO i=1 %TO &amp;amp;total;
 
ods listing style = map_symbols  gpath = '\\C:Macro Plots\Output Files' IMAGE_DPI=1200;
ODS GRAPHICS ON / imagename = 'NA Test Map' IMAGEFMT=png IMAGEMAP=on BORDER=off; OPTIONS NOBYLINE;

data annoimage; length function $10.; function = 'image'; height = 90; width = 100; drawspace = 'wallpercent';
image = '\\C:Analysis Files\Plot Background.jpg';
layer = 'back'; run;

PROC SGPLOT DATA=macrovar NOAUTOLEGEND NOCYCLEATTRS sganno =annoImage;
WHERE Site_Code="&amp;amp;&amp;amp;Site_Code&amp;amp;i";
TITLE;
YAXIS grid gridattrs = (color = black) display = (noline nolabel noticks novalues) values=(0 to 100 by 5);
XAXIS grid gridattrs = (color = black) display =(noline nolabel noticks novalues) values=(0 to 100 by 5);
SCATTER x = US_X y = US_Y/
 
ODS GRAPHICS OFF; ODS _ALL_ CLOSE; ODS LISTING CLOSE; %END; %MEND SGPLOT; %SGPLOT;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 May 2022 15:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812694#M22828</guid>
      <dc:creator>fastb</dc:creator>
      <dc:date>2022-05-11T15:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Background Image for Plots Generated with SGPLOT Macro</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812695#M22829</link>
      <description>&lt;P&gt;The slashes appear to be in the wrong place.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;image = '\\C:Analysis Files\Plot Background.jpg';&lt;/LI-CODE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;image = 'C:\\Analysis Files\\Plot Background.jpg';&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 15:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812695#M22829</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2022-05-11T15:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Background Image for Plots Generated with SGPLOT Macro</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812933#M22830</link>
      <description>&lt;P&gt;Were there any error messages in the SAS log?&lt;/P&gt;
&lt;P&gt;That should probably point you in the right direction!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might need to turn on more robust messages in the log to help get more info.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I'm remembering correctly, something like ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options source mprint;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 12:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Background-Image-for-Plots-Generated-with-SGPLOT-Macro/m-p/812933#M22830</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2022-05-12T12:35:44Z</dc:date>
    </item>
  </channel>
</rss>

