<?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: ODS Graphics trick: Plotting a turkey with SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/237012#M8596</link>
    <description>&lt;P&gt;Turns out these are not polygons, but lines. &amp;nbsp;Here is some fun with Series and Splines. &amp;nbsp;Only the TomTurkey data set is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*--Line Turkey--*/&lt;BR /&gt;ods graphics / reset width=5in height=4in imagename='Turkey';&lt;BR /&gt;proc sgplot data=TomTurkey aspect=1 nowall noborder;&lt;BR /&gt; title 'Happy Turkey Day';&lt;BR /&gt; series x=x y=y / group=shapeid lineattrs=graphdata1(thickness=2);&lt;BR /&gt; xaxis display=none;&lt;BR /&gt; yaxis display=none;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*--Smooth Turkey--*/&lt;BR /&gt;ods graphics / reset width=5in height=4in imagename='TurkeySmooth';&lt;BR /&gt;proc sgplot data=TomTurkey aspect=1 nowall noborder;&lt;BR /&gt; title 'Happy Turkey Day';&lt;BR /&gt; series x=x y=y / group=shapeid lineattrs=graphdata1(thickness=2) smoothconnect;&lt;BR /&gt; xaxis display=none;&lt;BR /&gt; yaxis display=none;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*--Spline Turkey--*/&lt;BR /&gt;ods graphics / reset width=5in height=4in imagename='TurkeySpline';&lt;BR /&gt;proc sgplot data=TomTurkey aspect=1 nowall noborder;&lt;BR /&gt; title 'Happy Turkey Day';&lt;BR /&gt; spline x=x y=y / group=shapeid lineattrs=graphdata1(thickness=2);&lt;BR /&gt; xaxis display=none;&lt;BR /&gt; yaxis display=none;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/978i9B67F88AA92776D2/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="TurkeySpline.png" title="TurkeySpline.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2015 16:50:52 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2015-11-30T16:50:52Z</dc:date>
    <item>
      <title>ODS Graphics trick: Plotting a turkey with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/236937#M8592</link>
      <description>&lt;P&gt;This is a little bit late for American Thanksgiving, but I just noticed this program shared from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc﻿&lt;/a&gt;&amp;nbsp;on &lt;A href="https://listserv.uga.edu/cgi-bin/wa?A2=ind1511e&amp;amp;L=SAS-L&amp;amp;D=0&amp;amp;P=344" target="_self"&gt;SAS-L&lt;/A&gt; and &lt;A href="https://twitter.com/vivasasvegas/status/669962759241641985" target="_self"&gt;on Twitter&lt;/A&gt;. &amp;nbsp;He used some plot point data from &lt;A href="http://www.math-aids.com/Graphing/Four_Quadrant_Graphing_Characters.html" target="_self"&gt;http://math-aids.com&lt;/A&gt; to create a fun turkey image with -- of all things -- a&amp;nbsp;&lt;STRONG&gt;SCATTER&lt;/STRONG&gt; plot statement in PROC SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/967iBDF38D7EBF9B5801/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="turkey.png" title="turkey.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the complete program, data included. &amp;nbsp;It can run in SAS University Edition or SAS Enterprise Guide (as well as in Base SAS, of course).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Program courtesy of Ted Conway on SAS-L */
/* Data plot points from http://math-aids.com */
data TomTurkey(keep=shapeID x y);
  length shapeID $ 20. x 8 y 8;
  retain shapeID;
  infile datalines4;
  input;
  if _infile_=:'Shape' then
    shapeID=_infile_;
  else
    do;
      i=1;
      do while(scan(_infile_, i, '(), ')^='');
        x=scan(_infile_, i, '(), ');
        y=scan(_infile_, i+1, '(), ');
        i+2;
        output;
      end;
    end;
datalines4;
Shape 1
(-3,-11) , (-3.5,-12.5) , (-4,-12) , (-4.5,-12.5) , (-4,-13) , (-3,-14) , (-2,-15.5) , (-1.5,-16) , (-1.5,-15.5) , (-2,-14)
(-1,-15) , (0,-15.5) , (-.5,-14.5) , (-1,-14) , (0,-14.5) , (0,-14) , (-.5,-13.5) , (-2,-13) , (-2.5,-12.5) , (-1.5,-11.5) , (-3,-11)
Shape 2
(-1.5,-11.5) , (0,-11.5) , (.5,-12) , (.5,-13) , (-.5,-12.5) , (-.5,-13.5) , (0,-14) , (1.5,-15) , (2,-16) , (2.5,-15.5) , (2,-15)
(3,-15.5) , (3.5,-15.5) , (3.5,-15) , (2,-14.5) , (3,-14.5) , (3.5,-14.5) , (3.5,-14) , (2,-13.5) , (1,-13.5) , (1.5,-12.5) , (.5,-12)
Shape 3
(1.5,-12.5) , (2.5,-11.5) , (4.5,-11.5) , (6.5,-10) , (7.5,-8.5) , (9,-7) , (9.5,-5.5) , (10.5,-4)
(10.5,-3) , (10,-2.5) , (8.5,-2) , (9.5,-3.5) , (9.5,-5.5)
Shape 4
(-3,-11) , (-4,-10) , (-4,-8.5) , (-5.5,-7) , (-4,-8) , (-3,-8) , (-1,-7.5) , (2,-6) , (4.5,-4) , (5.5,-1.5) , (7,-2.5) , (8.5,-2)
Shape 5
(-5.5,-7) , (-6.5,-6.5) , (-7,-5.5) , (-8,-5) , (-8,-3.5) , (-9,-3.5) , (-9.5,-3) , (-10.5,-3) , (-10.5,-4)
(-10,-5.5) , (-9,-6.5) , (-8,-6.5) , (-7,-5.5)
Shape 6
(-10.5,-3) , (-11.5,-2.5) , (-12,-1) , (-11,1) , (-9,1) , (-10.5,0) , (-11,-1) , (-10.5,-2) , (-9.5,-2) , (-9.5,-3)
Shape 7
(-9,1) , (-8,1.5) , (-8,0) , (-7,-.5) , (-7,-1.5) , (-6,-2.5) , (-5,-2.5) , (-5,-3.5) , (-4,-4.5)
(-3,-4.5) , (-3.5,-5.5) , (-2,-6) , (-1.5,-7) , (-1,-7.5)
Shape 8
(-8,1.5) , (-7,2) , (-6,2.5) , (-3.5,2.5) , (-4,2) , (-4,1) , (-3,.5) , (-3.5,0) , (-3,-1) , (-2,-1)
(-2.5,-2) , (-2,-3) , (-.5,-3) , (-1,-4) , (0,-5) , (.5,-4.5) , (1,-5.5) , (2,-6)
Shape 9
(-3.5,2.5) , (-1.5,2.5) , (-1.5,2.5) , (.5,2) , (1.5,1.5) , (2.5,1) , (3.5,.5) , (5,-1) , (5.5,-1.5)
Shape 10
(-11,1) , (-12,2) , (-11.5,4) , (-10.5,5) , (-8.5,4) , (-6,2.5)
Shape 11
(-10.5,5) , (-10.5,6) , (-10,7.5) , (-9,8.5) , (-8,8.5) , (-6,6) , (-3.5,2.5)
Shape 12
(-8,8.5) , (-7.5,10) , (-6.5,10.5) , (-5.5,11) , (-4.5,10.5) , (-3.5,7.5) , (-2.5,5) , (-1.5,2.5)
Shape 13
(-4.5,10.5) , (-4,11.5) , (-3,12) , (-2,12.5) , (-1,12) , (-.5,11.5) , (-.5,7) , (-.5,2.5)
Shape 14
(-.5,11.5) , (0,12.5) , (1,12.5) , (2.5,12) , (3.5,11) , (2.5,8) , (.5,2)
Shape 15
(3.5,11) , (5,11) , (6,10.5) , (7,9) , (4,5) , (1.5,1.5)
Shape 16
(7,9) , (8.5,8.5) , (9.5,7) , (8,7.5) , (6.5,6.5) , (6,5) , (6,3.5) , (2.5,1)
Shape 17
(6,3.5) , (6,1) , (3.5,.5)
Shape 18
(6,1) , (5.5,0) , (5,-1)
Shape 19
(9.5,7) , (10.5,6.5) , (11,5) , (9.5,5) , (8,3) , (7.5,2) , (8,1.5) , (8.5,1.5) , (9,2.5) , (9.5,3.5)
(9.5,4.5) , (10.5,4.5) , (11,4) , (11,5)
Shape 20
(8.5,-2) , (8,.5) , (8,1.5)
Shape 21
(9.5,3.5) , (10,3) , (11.5,2.5) , (11,4)
Shape 22
(9.5,1.5) , (10.5,1.5) , (11.5,2.5) , (10,3) , (9.5,2.5) , (9.5,1.5) , (9,1) , (8,.5)
Shape 23
(10.5,1.5) , (11.5,1) , (11.5,0) , (11,-2) , (10,-2.5)
Shape 24
(8.5,6) , (8,5.5) , (8.5,5) , (9,5.5) , (8.5,6)
Shape 25
(9,5.5) , (8.5,5.5) , (8.5,5)
;;;;
run;

data line(keep=function drawspace x1 y1 x2 y2);
  set TomTurkey;
  by shapeID notsorted;
  function='line';
  drawspace='datavalue';
  x1=lag(x);
  y1=lag(y);
  x2=x;
  y2=y;
  if ^first.shapeID;
run;

proc sgplot data=TomTurkey aspect=1 sganno=line;
  scatter x=x y=y / markerattrs=(size=0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks to Ted for the fun example!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 13:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/236937#M8592</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-11-30T13:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Graphics trick: Plotting a turkey with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/236964#M8594</link>
      <description>&lt;P&gt;Very cool. &amp;nbsp;Just a reminder...SAS 9,4 SGPLOT&amp;nbsp;also supports the POLYGON plot statement, so some of the vertex points from the original data set could have been used to directly drive a polygon plot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 14:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/236964#M8594</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-11-30T14:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Graphics trick: Plotting a turkey with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/236988#M8595</link>
      <description>&lt;P&gt;Ok, but you only get a like if you post the code to make the sound to go with it though.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#win-callrout-sound.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#win-callrout-sound.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/236988#M8595</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-30T15:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Graphics trick: Plotting a turkey with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/237012#M8596</link>
      <description>&lt;P&gt;Turns out these are not polygons, but lines. &amp;nbsp;Here is some fun with Series and Splines. &amp;nbsp;Only the TomTurkey data set is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*--Line Turkey--*/&lt;BR /&gt;ods graphics / reset width=5in height=4in imagename='Turkey';&lt;BR /&gt;proc sgplot data=TomTurkey aspect=1 nowall noborder;&lt;BR /&gt; title 'Happy Turkey Day';&lt;BR /&gt; series x=x y=y / group=shapeid lineattrs=graphdata1(thickness=2);&lt;BR /&gt; xaxis display=none;&lt;BR /&gt; yaxis display=none;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*--Smooth Turkey--*/&lt;BR /&gt;ods graphics / reset width=5in height=4in imagename='TurkeySmooth';&lt;BR /&gt;proc sgplot data=TomTurkey aspect=1 nowall noborder;&lt;BR /&gt; title 'Happy Turkey Day';&lt;BR /&gt; series x=x y=y / group=shapeid lineattrs=graphdata1(thickness=2) smoothconnect;&lt;BR /&gt; xaxis display=none;&lt;BR /&gt; yaxis display=none;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*--Spline Turkey--*/&lt;BR /&gt;ods graphics / reset width=5in height=4in imagename='TurkeySpline';&lt;BR /&gt;proc sgplot data=TomTurkey aspect=1 nowall noborder;&lt;BR /&gt; title 'Happy Turkey Day';&lt;BR /&gt; spline x=x y=y / group=shapeid lineattrs=graphdata1(thickness=2);&lt;BR /&gt; xaxis display=none;&lt;BR /&gt; yaxis display=none;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/978i9B67F88AA92776D2/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="TurkeySpline.png" title="TurkeySpline.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 16:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/237012#M8596</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-11-30T16:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Graphics trick: Plotting a turkey with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/239071#M8597</link>
      <description>Spawned an interesting side discussion about CALL SOUND, moved to the off-topic lounge.</description>
      <pubDate>Mon, 30 Nov 2015 17:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/239071#M8597</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-11-30T17:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Graphics trick: Plotting a turkey with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/237018#M8598</link>
      <description>I like it! Note for those trying this at home: the SPLINE statement was added just recently in SAS 9.4 maint 3.</description>
      <pubDate>Mon, 30 Nov 2015 17:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/ODS-Graphics-trick-Plotting-a-turkey-with-SGPLOT/m-p/237018#M8598</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-11-30T17:24:31Z</dc:date>
    </item>
  </channel>
</rss>

