<?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 w/SAS ODS Graphics: Morning Headline News for Wed., Nov. 9, 2016 in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/312922#M11008</link>
    <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5923iA73B1B4ACDD81143/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="ELECTION2016.jpeg" title="ELECTION2016.jpeg" /&gt;&lt;/P&gt;
&lt;P&gt;Here's a cartogram that presents Presidential election results together with morning-after newspaper front page thumbnails for each of the 50 states + DC (full-size front pages can be viewed at &lt;A href="http://www.newseum.org/todaysfrontpages/?tfp_display=archive-date&amp;amp;tfp_archive_id=110916" target="_blank"&gt;the Newseum&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DETAIL&lt;/STRONG&gt; (right-click image above, select open-image-in-new-tab&amp;nbsp;&amp;amp; click magnifying glass to see detail)&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5924iA3C913AB2DAA74BA/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="WisconsinDetail.png" title="WisconsinDetail.png" /&gt;&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;*==&amp;gt; Tile Map of 2016 Presidential election outcome w/morning headlines;

*==&amp;gt; US tile map coordinates from Matt Chambers
     drive.google.com/file/d/0B24QRdfcy_JJZFRKLUZzMHZYbG8/view;

data StateGrid;
input statecode : $2. row column@@;
row=-row;                   * Flip map's y-coordinates (FL at bottom, ME at top!);
row=.875*row;               * Tighten up line spacing;
StateIDcolumn=column-.365;  * X-position of state abbreviation labels;
VoteIDcolumn=column+.32;    * X-position of state's # of electoral votes;

cards;
AK 0 0.5 ME 0 11.5        
VT 1 10 NH 1 11        
WA 2 1.5 MT 2 2.5 ND 2 3.5 MN 2 4.5 WI 2 5.5 MI 2 7.5 NY 2 9.5 MA 2 10.5 RI 2 11.5 
ID 3 2 WY 3 3 SD 3 4 IA 3 5 IL 3 6 IN 3 7 OH 3 8 PA 3 9 NJ 3 10 CT 3 11
OR 4 1.5 NV 4 2.5 CO 4 3.5 NE 4 4.5 MO 4 5.5 KY 4 6.5 WV 4 7.5 MD 4 8.5 DE 4 9.5 
CA 5 2 AZ 5 3 UT 5 4 KS 5 5 AR 5 6 TN 5 7 VA 5 8 NC 5 9 DC 5 12 
NM 6 3.5 OK 6 4.5 LA 6 5.5 MS 6 6.5 AL 6 7.5 SC 6 8.5    
TX 7 4 GA 7 8        
HI 8 0.5 FL 8 8.5 
;
*==&amp;gt; Get state winners (en.wikipedia.org/wiki/United_States_presidential_election,_2016);

data stateWinner;
input statecode : $2. party $1.@@;
cards;
AL R FL R LA R NE R OK R VT D
AK R GA R ME D NV D OR D VA D
AZ R HI D MD D NH D PA R WA D
AR R ID R MA D NJ D RI D WV R
CA D IL D MI R NM D SC R WI R
CO D IN R MN D NY D SD R WY R
CT D IA R MS R NC R TN R
DE D KS R MO R ND R TX R
DC D KY R MT R OH R UT R
;
*==&amp;gt; Get electoral votes in each state (en.wikipedia.org/wiki/Electoral_College_(United_States));

data stateVotes;
input statecode : $2. votes@@;
cards;
AL 9 AK 3 AZ 11 AR 6 CA 55 CO 9 CT 7 DC 3 DE 3 FL 29 GA 16 HI 4 ID 4 IL 20 IN 11 IA 6 KS 6 
KY 8 LA 8 ME 4 MD 10 MA 11 MI 16 MN 10 MS 6 MO 10 MT 3 NE 5 NV 6 NH 4 NJ 14 NM 5 NY 29 NC 15 
ND 3 OH 18 OK 7 OR 7 PA 20 RI 4 SC 9 SD 3 TN 11 TX 38 UT 6 VT 3 VA 13 WA 12 WV 5 WI 10 WY 3
;
*==&amp;gt; Merge map coordinates, state winners and electoral votes;

proc sql;
create table stategridParty as 
select sg.*, sw.Party, sv.Votes
from stategrid sg, statewinner sw, statevotes sv
where sg.statecode=sw.statecode and sg.statecode=sv.statecode order by sw.statecode;

proc sql noprint;   * Get a list of state codes (used to map states to image files);
select statecode into :stcodes separated by ' ' from stateWinner order by 1;

*==&amp;gt; Thumbnails of 11-9-2016 headlines (one per state), full-size front pages available at:
*==&amp;gt; www.newseum.org/todaysfrontpages/?tfp_display=archive-date&amp;amp;tfp_archive_id=110916;

options macrogen; * A little less confusing if you see what is generated;
%macro gensymbols;
%do s=1 %to 51;   * Define symbols, link to .png thumbnail w/state headlines;
  %let st=%scan(&amp;amp;stcodes,&amp;amp;s);
  symbolimage name=sym&amp;amp;st image="/folders/myfolders/News/&amp;amp;st..png";
%end;
                  * Attrobute map ties symbols to state codes values from earler SQL;
discreteattrmap name="symbols" / ignorecase=true trimleading=true;
%do s=1 %to 51;
  %let st=%scan(&amp;amp;stcodes,&amp;amp;s);
  value "&amp;amp;st" / markerattrs=(symbol=sym&amp;amp;st size=74pt);
%end;
enddiscreteattrmap;
%mend;

*==&amp;gt; Data prep done, time for fun - chart states, winners, votes, headlines!;

ods listing image_dpi=216 gpath='/folders/myfolders'; * $249 laptop is memory-challenged, so 216 dpi;
ods graphics on / reset imagefmt=jpeg noborder antialias width=22.5in height=16.5in imagename="ELECTION2016";
proc template;
define statgraph ellipseparm;
begingraph;             * Map political parties to their colors;
  discreteAttrMap name='PartyColor';
    value 'D' / fillattrs=(color=blue);
    value 'R' / fillattrs=(color=red);
   endDiscreteAttrMap;
   discreteAttrVar attrVar=PartyC var=Party attrMap="PartyColor";
   %gensymbols;                                        * Map state codes to .png files w/front page thumbnails;
   discreteattrvar attrvar=StateMarkers var=statecode attrmap="symbols";
   layout overlayequated / xaxisopts=(offsetmin=.01 offsetmax=.01 display=none)
     yaxisopts=(offsetmin=.01 offsetmax=.01 display=none);
     entry "HEADLINE NEWS FOR NOV 9, 2016" / valign=bottom textattrs=(size=24pt weight=bold);     
     ellipseparm semimajor=.49 semiminor=.49 slope=0    /* Red/blue circles represent party */
                 xorigin=column yorigin=row  / group=partyC display=(fill);
     textplot x=StateIDcolumn y=row text=statecode /    /* Plot state code inside circle on left */
              position=center textattrs=(color=CXffffff size=11pt weight=bold);
     textplot x=voteIDcolumn y=row text=votes /         /* Plot # electoral votes inside circle on right */
              position=center textattrs=(color=CXffffff size=11pt weight=bold);
     scatterplot x=column y=row / group=StateMarkers;   /* Add morning headline thumbnails */ 
   endlayout;
  endGraph;
 end;
run;

proc sgrender data=stategridParty template=ellipseparm;
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>Mon, 21 Nov 2016 12:18:42 GMT</pubDate>
    <dc:creator>tc</dc:creator>
    <dc:date>2016-11-21T12:18:42Z</dc:date>
    <item>
      <title>Fun w/SAS ODS Graphics: Morning Headline News for Wed., Nov. 9, 2016</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/312922#M11008</link>
      <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5923iA73B1B4ACDD81143/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="ELECTION2016.jpeg" title="ELECTION2016.jpeg" /&gt;&lt;/P&gt;
&lt;P&gt;Here's a cartogram that presents Presidential election results together with morning-after newspaper front page thumbnails for each of the 50 states + DC (full-size front pages can be viewed at &lt;A href="http://www.newseum.org/todaysfrontpages/?tfp_display=archive-date&amp;amp;tfp_archive_id=110916" target="_blank"&gt;the Newseum&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DETAIL&lt;/STRONG&gt; (right-click image above, select open-image-in-new-tab&amp;nbsp;&amp;amp; click magnifying glass to see detail)&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5924iA3C913AB2DAA74BA/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="WisconsinDetail.png" title="WisconsinDetail.png" /&gt;&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;*==&amp;gt; Tile Map of 2016 Presidential election outcome w/morning headlines;

*==&amp;gt; US tile map coordinates from Matt Chambers
     drive.google.com/file/d/0B24QRdfcy_JJZFRKLUZzMHZYbG8/view;

data StateGrid;
input statecode : $2. row column@@;
row=-row;                   * Flip map's y-coordinates (FL at bottom, ME at top!);
row=.875*row;               * Tighten up line spacing;
StateIDcolumn=column-.365;  * X-position of state abbreviation labels;
VoteIDcolumn=column+.32;    * X-position of state's # of electoral votes;

cards;
AK 0 0.5 ME 0 11.5        
VT 1 10 NH 1 11        
WA 2 1.5 MT 2 2.5 ND 2 3.5 MN 2 4.5 WI 2 5.5 MI 2 7.5 NY 2 9.5 MA 2 10.5 RI 2 11.5 
ID 3 2 WY 3 3 SD 3 4 IA 3 5 IL 3 6 IN 3 7 OH 3 8 PA 3 9 NJ 3 10 CT 3 11
OR 4 1.5 NV 4 2.5 CO 4 3.5 NE 4 4.5 MO 4 5.5 KY 4 6.5 WV 4 7.5 MD 4 8.5 DE 4 9.5 
CA 5 2 AZ 5 3 UT 5 4 KS 5 5 AR 5 6 TN 5 7 VA 5 8 NC 5 9 DC 5 12 
NM 6 3.5 OK 6 4.5 LA 6 5.5 MS 6 6.5 AL 6 7.5 SC 6 8.5    
TX 7 4 GA 7 8        
HI 8 0.5 FL 8 8.5 
;
*==&amp;gt; Get state winners (en.wikipedia.org/wiki/United_States_presidential_election,_2016);

data stateWinner;
input statecode : $2. party $1.@@;
cards;
AL R FL R LA R NE R OK R VT D
AK R GA R ME D NV D OR D VA D
AZ R HI D MD D NH D PA R WA D
AR R ID R MA D NJ D RI D WV R
CA D IL D MI R NM D SC R WI R
CO D IN R MN D NY D SD R WY R
CT D IA R MS R NC R TN R
DE D KS R MO R ND R TX R
DC D KY R MT R OH R UT R
;
*==&amp;gt; Get electoral votes in each state (en.wikipedia.org/wiki/Electoral_College_(United_States));

data stateVotes;
input statecode : $2. votes@@;
cards;
AL 9 AK 3 AZ 11 AR 6 CA 55 CO 9 CT 7 DC 3 DE 3 FL 29 GA 16 HI 4 ID 4 IL 20 IN 11 IA 6 KS 6 
KY 8 LA 8 ME 4 MD 10 MA 11 MI 16 MN 10 MS 6 MO 10 MT 3 NE 5 NV 6 NH 4 NJ 14 NM 5 NY 29 NC 15 
ND 3 OH 18 OK 7 OR 7 PA 20 RI 4 SC 9 SD 3 TN 11 TX 38 UT 6 VT 3 VA 13 WA 12 WV 5 WI 10 WY 3
;
*==&amp;gt; Merge map coordinates, state winners and electoral votes;

proc sql;
create table stategridParty as 
select sg.*, sw.Party, sv.Votes
from stategrid sg, statewinner sw, statevotes sv
where sg.statecode=sw.statecode and sg.statecode=sv.statecode order by sw.statecode;

proc sql noprint;   * Get a list of state codes (used to map states to image files);
select statecode into :stcodes separated by ' ' from stateWinner order by 1;

*==&amp;gt; Thumbnails of 11-9-2016 headlines (one per state), full-size front pages available at:
*==&amp;gt; www.newseum.org/todaysfrontpages/?tfp_display=archive-date&amp;amp;tfp_archive_id=110916;

options macrogen; * A little less confusing if you see what is generated;
%macro gensymbols;
%do s=1 %to 51;   * Define symbols, link to .png thumbnail w/state headlines;
  %let st=%scan(&amp;amp;stcodes,&amp;amp;s);
  symbolimage name=sym&amp;amp;st image="/folders/myfolders/News/&amp;amp;st..png";
%end;
                  * Attrobute map ties symbols to state codes values from earler SQL;
discreteattrmap name="symbols" / ignorecase=true trimleading=true;
%do s=1 %to 51;
  %let st=%scan(&amp;amp;stcodes,&amp;amp;s);
  value "&amp;amp;st" / markerattrs=(symbol=sym&amp;amp;st size=74pt);
%end;
enddiscreteattrmap;
%mend;

*==&amp;gt; Data prep done, time for fun - chart states, winners, votes, headlines!;

ods listing image_dpi=216 gpath='/folders/myfolders'; * $249 laptop is memory-challenged, so 216 dpi;
ods graphics on / reset imagefmt=jpeg noborder antialias width=22.5in height=16.5in imagename="ELECTION2016";
proc template;
define statgraph ellipseparm;
begingraph;             * Map political parties to their colors;
  discreteAttrMap name='PartyColor';
    value 'D' / fillattrs=(color=blue);
    value 'R' / fillattrs=(color=red);
   endDiscreteAttrMap;
   discreteAttrVar attrVar=PartyC var=Party attrMap="PartyColor";
   %gensymbols;                                        * Map state codes to .png files w/front page thumbnails;
   discreteattrvar attrvar=StateMarkers var=statecode attrmap="symbols";
   layout overlayequated / xaxisopts=(offsetmin=.01 offsetmax=.01 display=none)
     yaxisopts=(offsetmin=.01 offsetmax=.01 display=none);
     entry "HEADLINE NEWS FOR NOV 9, 2016" / valign=bottom textattrs=(size=24pt weight=bold);     
     ellipseparm semimajor=.49 semiminor=.49 slope=0    /* Red/blue circles represent party */
                 xorigin=column yorigin=row  / group=partyC display=(fill);
     textplot x=StateIDcolumn y=row text=statecode /    /* Plot state code inside circle on left */
              position=center textattrs=(color=CXffffff size=11pt weight=bold);
     textplot x=voteIDcolumn y=row text=votes /         /* Plot # electoral votes inside circle on right */
              position=center textattrs=(color=CXffffff size=11pt weight=bold);
     scatterplot x=column y=row / group=StateMarkers;   /* Add morning headline thumbnails */ 
   endlayout;
  endGraph;
 end;
run;

proc sgrender data=stategridParty template=ellipseparm;
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>Mon, 21 Nov 2016 12:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/312922#M11008</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2016-11-21T12:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: Morning Headline News for Wed., Nov. 9, 2016</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/313181#M11011</link>
      <description>&lt;P&gt;Awesome, Ted. &amp;nbsp;I am sure your posts under the "Fun w/SAS ODS Graphics" topic are opening many eyes to the features and flexibility of this graph framework. &amp;nbsp;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 18:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/313181#M11011</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-11-21T18:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: Morning Headline News for Wed., Nov. 9, 2016</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/313211#M11012</link>
      <description>&lt;P&gt;At first I read the intro as "cardiogram" (instead of cartogram) and thought that might be revealing as well...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nice job again, Ted!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, readers can see the full size image by right-clicking on it and select "Open image in a new tab" in your favorite browser. &lt;A href="https://communities.sas.com/t5/image/serverpage/image-id/5923iA73B1B4ACDD81143/image-size/original?v=v2&amp;amp;px=-1" target="_blank"&gt;Or via this link&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 19:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/313211#M11012</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-11-21T19:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: Morning Headline News for Wed., Nov. 9, 2016</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/314747#M11062</link>
      <description>&lt;P&gt;Cool graphs, Nice for ideas. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 06:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-Morning-Headline-News-for-Wed-Nov-9-2016/m-p/314747#M11062</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2016-11-28T06:55:17Z</dc:date>
    </item>
  </channel>
</rss>

