<?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 Fun with SAS ODS Graphics: &amp;quot;Three Flags&amp;quot; for July 4th in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/570049#M18394</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="threeflags.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30638i28A10A8EE0B96B3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="threeflags.png" alt="threeflags.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In advance of Independence Day, here's a quick SAS ODS Graphics bar-and-scatter-plots take on &lt;A href="https://whitney.org/collection/works/1060" target="_self"&gt;Three Flags&lt;/A&gt; by Jasper Johns. Enjoy the holiday, all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CODE&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun with SAS ODS Graphics: "Three Flags" for July 4th
  A SAS ODS Graphics take on "Three Flags" by Jasper Johns (whitney.org/collection/works/1060);

data stripes; * Generate points for flag stripes;
do y1=1 to 14;
  x=mod(y1,2); * Alternate red and white stripes (bar length of 1 or 0);
  output;
end;

data canton; * Generate points for canton (blue rectangle in upper left corner);
do y2=1 to 14;
  x=.4625*(y2&amp;lt;=7); * Blue over first 7 stripes covering 46.25% of flag width;
  output;
end;

data stars; * Generate points for 48 stars (arranged in 6 rows of 8 stars - painted in 1958);
do r=1 to 6;
  y3=.79+(r-1)*1.08; * Distribute vertically over first 7 stripes;
  do c=1 to 8; 
    x=.0355+0.96*.4625/8*(c-1); * Distribute horizontally over width of canton;
    output;
  end;
end;

data flag; * Merge flag objects together;
set stripes canton stars;

ods listing gpath='/folders/myfolders'; * Save generated flag image;
ods graphics on / reset antialias width=7.38in height=5in imagename="oneflag" border=off; * Width is 1.476 x height;

proc sgplot data=flag noautolegend pad=0 nowall noborder subpixel; * Generate a flag - two bars charts + scatter plot;
styleattrs backcolor=CXF0F0D8; * Background (Beige);
symbolchar name=uniStar char='2605'x; * Unicode value for 5-pointed star;
hbarbasic y1 / response=x barwidth=1 nooutline fillattrs=(color=CXB22234 transparency=.2) nozerobars discreteoffset=.5; * Stripes (Red);
hbarbasic y2 / response=x barwidth=1 nooutline fillattrs=(color=CX3C3B6E) nozerobars discreteoffset=.5; * Canton (Blue);
scatter x=x y=y3 / y2axis markerattrs=(symbol=uniStar color=CXF0F0D8 size=41pt); * Stars (Beige);
xaxis display=none offsetmin=0 offsetmax=0; 
yaxis display=none offsetmin=0 offsetmax=0 type=discrete;
y2axis display=none type=linear min=0 max=13 offsetmin=0 offsetmax=0;

data threeflags; * Stitch trio of flag images together, each about 24 % smaller than previous one;
x=.5; y=.5;

proc template; * Use GTL to overlay the three flag images on top of a "dummy" scatter plot;
define statgraph image;
begingraph / subpixel=on border=false;
layout overlay;
scatterplot x=x y=y / markerattrs=(size=0); * "Dummy" scatter plot;
drawimage "/folders/myfolders/oneflag.png" / border=true borderattrs=(color=black thickness=4pt) height=100 
          heightunit=percent scale=fitheight drawspace=graphpercent; * Back flag is 100% of original image size;
drawimage "/folders/myfolders/oneflag.png" / border=true borderattrs=(color=black thickness=.05pt) height=76 
          heightunit=percent scale=fitheight drawspace=graphpercent; * Middle flag is about 25% of original image size;
drawimage "/folders/myfolders/oneflag.png" / border=true borderattrs=(color=black thickness=.05pt) 
          height=58 heightunit=percent scale=fitheight drawspace=graphpercent; * Front flag is about 25% of previous image size;
endlayout;
endgraph;
end;

ods graphics on / reset antialias width=7.38in height=5in imagename="threeflags" border=off; * Width is 1.476 x height;
proc sgrender data=threeflags template=image;&lt;/CODE&gt;&lt;/PRE&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="Original Masterpiece" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30640i2AB649603F63E50C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="threeflagsJJ.png" alt="Original Masterpiece" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Original Masterpiece&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bar and Scatter Plot Knockoff" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30641iE57FB232AA2090A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="threeflags.png" alt="Bar and Scatter Plot Knockoff" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Bar and Scatter Plot Knockoff&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jun 2019 17:31:00 GMT</pubDate>
    <dc:creator>tc</dc:creator>
    <dc:date>2019-06-29T17:31:00Z</dc:date>
    <item>
      <title>Fun with SAS ODS Graphics: "Three Flags" for July 4th</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/570049#M18394</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="threeflags.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30638i28A10A8EE0B96B3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="threeflags.png" alt="threeflags.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In advance of Independence Day, here's a quick SAS ODS Graphics bar-and-scatter-plots take on &lt;A href="https://whitney.org/collection/works/1060" target="_self"&gt;Three Flags&lt;/A&gt; by Jasper Johns. Enjoy the holiday, all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CODE&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun with SAS ODS Graphics: "Three Flags" for July 4th
  A SAS ODS Graphics take on "Three Flags" by Jasper Johns (whitney.org/collection/works/1060);

data stripes; * Generate points for flag stripes;
do y1=1 to 14;
  x=mod(y1,2); * Alternate red and white stripes (bar length of 1 or 0);
  output;
end;

data canton; * Generate points for canton (blue rectangle in upper left corner);
do y2=1 to 14;
  x=.4625*(y2&amp;lt;=7); * Blue over first 7 stripes covering 46.25% of flag width;
  output;
end;

data stars; * Generate points for 48 stars (arranged in 6 rows of 8 stars - painted in 1958);
do r=1 to 6;
  y3=.79+(r-1)*1.08; * Distribute vertically over first 7 stripes;
  do c=1 to 8; 
    x=.0355+0.96*.4625/8*(c-1); * Distribute horizontally over width of canton;
    output;
  end;
end;

data flag; * Merge flag objects together;
set stripes canton stars;

ods listing gpath='/folders/myfolders'; * Save generated flag image;
ods graphics on / reset antialias width=7.38in height=5in imagename="oneflag" border=off; * Width is 1.476 x height;

proc sgplot data=flag noautolegend pad=0 nowall noborder subpixel; * Generate a flag - two bars charts + scatter plot;
styleattrs backcolor=CXF0F0D8; * Background (Beige);
symbolchar name=uniStar char='2605'x; * Unicode value for 5-pointed star;
hbarbasic y1 / response=x barwidth=1 nooutline fillattrs=(color=CXB22234 transparency=.2) nozerobars discreteoffset=.5; * Stripes (Red);
hbarbasic y2 / response=x barwidth=1 nooutline fillattrs=(color=CX3C3B6E) nozerobars discreteoffset=.5; * Canton (Blue);
scatter x=x y=y3 / y2axis markerattrs=(symbol=uniStar color=CXF0F0D8 size=41pt); * Stars (Beige);
xaxis display=none offsetmin=0 offsetmax=0; 
yaxis display=none offsetmin=0 offsetmax=0 type=discrete;
y2axis display=none type=linear min=0 max=13 offsetmin=0 offsetmax=0;

data threeflags; * Stitch trio of flag images together, each about 24 % smaller than previous one;
x=.5; y=.5;

proc template; * Use GTL to overlay the three flag images on top of a "dummy" scatter plot;
define statgraph image;
begingraph / subpixel=on border=false;
layout overlay;
scatterplot x=x y=y / markerattrs=(size=0); * "Dummy" scatter plot;
drawimage "/folders/myfolders/oneflag.png" / border=true borderattrs=(color=black thickness=4pt) height=100 
          heightunit=percent scale=fitheight drawspace=graphpercent; * Back flag is 100% of original image size;
drawimage "/folders/myfolders/oneflag.png" / border=true borderattrs=(color=black thickness=.05pt) height=76 
          heightunit=percent scale=fitheight drawspace=graphpercent; * Middle flag is about 25% of original image size;
drawimage "/folders/myfolders/oneflag.png" / border=true borderattrs=(color=black thickness=.05pt) 
          height=58 heightunit=percent scale=fitheight drawspace=graphpercent; * Front flag is about 25% of previous image size;
endlayout;
endgraph;
end;

ods graphics on / reset antialias width=7.38in height=5in imagename="threeflags" border=off; * Width is 1.476 x height;
proc sgrender data=threeflags template=image;&lt;/CODE&gt;&lt;/PRE&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="Original Masterpiece" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30640i2AB649603F63E50C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="threeflagsJJ.png" alt="Original Masterpiece" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Original Masterpiece&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bar and Scatter Plot Knockoff" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30641iE57FB232AA2090A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="threeflags.png" alt="Bar and Scatter Plot Knockoff" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Bar and Scatter Plot Knockoff&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2019 17:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/570049#M18394</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2019-06-29T17:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fun with SAS ODS Graphics: "Three Flags" for July 4th</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/570273#M18398</link>
      <description>&lt;P&gt;Another great contribution to the collection that includes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Betsy-Ross-Edition/m-p/371961#M12855" target="_self"&gt;&lt;SPAN&gt;Fun With SAS ODS Graphics: Betsy Ross Edition&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-July-4th-Edition/m-p/281636#M9973" target="_self"&gt;&lt;SPAN&gt;Fun With SAS ODS Graphics, July 4th Edition (Fireworks)&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Stars-and-Stripes-Forever-Donut-Charts/m-p/475504#M16426" target="_self"&gt;&lt;SPAN&gt;Fun w/SAS ODS Graphics: Stars-and-Stripes-Forever Donut Charts&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;&amp;nbsp;!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 14:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/570273#M18398</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-07-01T14:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Fun with SAS ODS Graphics: "Three Flags" for July 4th</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/603923#M19112</link>
      <description>&lt;P&gt;Very cool flags!! But I noticed that it's only showing 48 stars. . .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 18:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-quot-Three-Flags-quot-for-July-4th/m-p/603923#M19112</guid>
      <dc:creator>SusanBerry</dc:creator>
      <dc:date>2019-11-13T18:19:23Z</dc:date>
    </item>
  </channel>
</rss>

