<?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: Fun with SAS ODS Graphics: MWSUG@30 in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591077#M18900</link>
    <description>&lt;P&gt;What a fun way to celebrate the 30th anniversary of MWSUG. Interesting to also see the most visited city is Chicago too!&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 04:32:56 GMT</pubDate>
    <dc:creator>MichelleHomes</dc:creator>
    <dc:date>2019-09-24T04:32:56Z</dc:date>
    <item>
      <title>Fun with SAS ODS Graphics: MWSUG@30</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591071#M18899</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MWSUG Conference Locations" style="width: 494px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32694i2A0F64F94201AF97/image-size/large?v=v2&amp;amp;px=999" role="button" title="MWSUG.png" alt="MWSUG Conference Locations" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;MWSUG Conference Locations&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Used &lt;STRONG&gt;SAS/GRAPH&lt;/STRONG&gt; in 2011 to &lt;A href="http://support.sas.com/resources/papers/proceedings11/220-2011.pdf" target="_self"&gt;knock out an image for a Zazzle t-shirt&lt;/A&gt; (&lt;EM&gt;production run of 1!&lt;/EM&gt;) commemorating the 36th anniversary of SAS Global Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, with &lt;A href="http://mwsug.org/2019/index.html" target="_self"&gt;MWSUG 2019&lt;/A&gt; kicking off next Sunday in Chicago, here's a quick &lt;STRONG&gt;SAS ODS Graphics&lt;/STRONG&gt; take on a chart to mark that conference's 30th anniversary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probably could've used the newer &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/12/14/sgmap-now-in-base-sas/" target="_self"&gt;SGMAP procedure&lt;/A&gt;, but after seeing tips in write-ups by &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/04/19/micro-maps/" target="_self"&gt;Sanjay Matange&lt;/A&gt;, &lt;A href="https://blogs.sas.com/content/iml/2015/11/18/create-a-map-with-proc-sgplot.html" target="_self"&gt;Rick Wicklin&lt;/A&gt;, &lt;A href="https://blogs.sas.com/content/sastraining/2017/03/21/create-pretty-map-proc-sgplot/" target="_self"&gt;Robert Allison&lt;/A&gt;, and &lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2346-2018.pdf" target="_self"&gt;Louise Hadden&lt;/A&gt;, decided to opt for PROC SGPLOT and polygon/scatter plots!&lt;/P&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="Zazzle T-Shirt Mockup" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32695i44BD3B164DB870B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mwsugzazzle.JPG" alt="Zazzle T-Shirt Mockup" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Zazzle T-Shirt Mockup&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPANEL Detail" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32696i2CA44DF401D36033/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mwsugchicago.png" alt="SGPANEL Detail" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;SGPANEL Detail&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SAS CODE&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun with SAS ODS Grapics: Maps of MWSUG Conference Locations (1990-2019);

data mwsugCities(keep=year city st);          * Get locations of past conferences from MWSUG website;
filename mwsug url "http://mwsug.org/pastconf.html"; * Web page with data on past conferences;
infile mwsug truncover;
input @"&amp;lt;tr&amp;gt;&amp;lt;td colspan=2&amp;gt;&amp;lt;b&amp;gt;" year 4. +3 cityst $char255.; * Scrape year, city, state;
if year^=.;
city=tranwrd(scan(cityst,1,","),"St. Louis","Saint Louis"); * Get city, recode St. Louis;
st=scan(scan(cityst,1,'&amp;lt;'),-1,",&amp;lt; ");         * Get state codes or names;
do s=1 to 56;                                 * Translate state names into codes;
  if st=fipnamel(s) then st=fipstate(s);      
end;  
 
proc sql;                                     * Add conference location for 2019;
insert into mwsugCities values(2019,"Chicago","IL");

                               * Map cities to colors (Tableau 10 Light RGB codes from gist.github.com/chebee7i/4041f848ee2710d500e6);
create table Hosted as select city, count(*) as hosted from mwsugCities group by 1 order by 2 desc, 1;

create table CityAttrMap as                   /* Create ODS Graphics attribute map of cities to colors for charts */
select "city" as id, city as value,           /* 13 colors for 13 unique cities */
       scan("CXAEC7E8 CXFFBB78 CX98DF8A CXFF9896 CXC5B0D5 CXC49C94 CXF7B6D2 CXC7C7C7 CXDBDB8D 
             CX9EDAE5 TAN GOLD TURQUOISE",monotonic()," ") as fillcolor
from hosted;
                                              * Add lat/long to conference locations;
create table mwsugCitiesGeo(rename=(x=xC y=yC)) as 
select m.year, u.* from mwsugCities m, sasfiles.uscity u
where m.city=u.city and m.st=u.statecode order by m.year;
  
libname mymaps '/folders/myfolders/mymaps/'; * Get outlines of MWSUG states from SAS US map;
data mwsugStates;
set mymaps.us(where=(statecode in ('IL' 'IN' 'IA' 'KS' 'MI' 'MN' 'MO' 'NE' 'ND' 'OH' 'SD' 'WI'))); 
seq=_n_+1;                                    * Maintain original order;
length pid $8;
keep state segment x y pid seq;
pid=put(state, 3.0)||put(segment, 3.0);       * Make unique polygon ID for each state+segment combo;

proc sql;                                     * Duplicate state outline data for each year and add year/city;
create table mwsugStates2 as select * from mwsugStates, mwsugCitiesGeo(keep=year City) order by seq;

data mwsug;                                   * Merge state outlines and city points together;
set mwsugStates2 mwsugCitiesGeo;

proc sql noprint;                             * Calc aspect ratio of points in map;
select (max(y)-min(y))/(max(x)-min(x)) into :aspect from mwsug; * Calc from: blogs.sas.com/content/sastraining/2017/03/21/create-pretty-map-proc-sgplot/;
 
ods listing image_dpi=250 gpath='/folders/myfolders/MWSUG2019/images'; * Image setup parameters;                                   
ods graphics on / reset antialias width=14in height=17in imagename="MWSUG" noborder ANTIALIASMAX=8400 LABELMAX=8400;
     
proc sgpanel data=mwsug aspect=&amp;amp;aspect subpixel noautolegend dattrmap=CityAttrMap; * Draw panel of maps!;
title height=54pt "MWSUG@30"; * 30 years of MWSUG conferences!;
panelby year / rows=6 columns=5 onepanel uniscale=all noheaderborder headerbackcolor=white novarname headerattrs=(weight=bold size=20pt color=black) noborder spacing=5;
rowaxis display=none offsetmin=.0 offsetmax=.0; colaxis display=none offsetmin=.0 offsetmax=.0;
polygon x=x y=y id=pid / fill outline group=city attrid=city lineattrs=(color=white); * Ploygon plot for maps, scatter plot for city points/labels;
scatter x=xc y=yc / markerattrs=(symbol=circlefilled color=black size=14pt) datalabel=city datalabelattrs=(weight=bold size=16pt color=black);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 03:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591071#M18899</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2019-09-24T03:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Fun with SAS ODS Graphics: MWSUG@30</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591077#M18900</link>
      <description>&lt;P&gt;What a fun way to celebrate the 30th anniversary of MWSUG. Interesting to also see the most visited city is Chicago too!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 04:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591077#M18900</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2019-09-24T04:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Fun with SAS ODS Graphics: MWSUG@30</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591153#M18903</link>
      <description>&lt;P&gt;That is very cool. I like idea of PROC SGPANEL .&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 12:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-with-SAS-ODS-Graphics-MWSUG-30/m-p/591153#M18903</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-24T12:48:57Z</dc:date>
    </item>
  </channel>
</rss>

