<?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: Knockoff of Viz 41 (dot plot) from &amp;quot;1 dataset 100 visualizations in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862460#M23563</link>
    <description>&lt;P&gt;With respect, I don't think this is a good visualization that is worthy of being reproduced. With no vertical axis, we are forced to count the number of dots if we want to know the number of sites in each country.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems like a simple bar chart is an easier and more effective presentation of these data. No doubt this is one of the "100 visualizations" that are considered.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You transposed the data from wide to long in the DATA step. I decided to use PROC TRANSPOSE, but either will work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sites;
input Year Norway   Denmark   Sweden;
datalines;
2004        5         4       13    
2022        8        10       15  
;

/* Transpose the variables from wide to long format */
proc transpose data=sites
   out=long(rename=(Col1=NumSites)) name=Country;                    
   by Year;                   /* for each subject */
   var Norway Denmark Sweden; /* make a row for these variables */
run;

title "World Heritage Sites in Scandinavia";
proc sgplot data=long;
   vbar Year / response=NumSites group=Country groupdisplay=cluster;
   label NumSites="Number of World Heritage Sites"
         Country="Country";
   xaxis display=(nolabel);
   yaxis integer grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot10.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81101iAE5DF1014EA9405C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot10.png" alt="SGPlot10.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 10:59:05 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2023-03-06T10:59:05Z</dc:date>
    <item>
      <title>Fun With SAS ODS Graphics: Knockoff of Viz 41 (dot plot) from "1 dataset 100 visualizations" project</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862413#M23562</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Viz41Knockoff.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81085i147D88B4410A2F81/image-size/large?v=v2&amp;amp;px=999" role="button" title="Viz41Knockoff.png" alt="Viz41Knockoff.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After seeing &lt;A href="https://www.ferdio.com/" target="_self"&gt;Ferdio&lt;/A&gt;'s creative &lt;A href="https://100.datavizproject.com/" target="_self"&gt;"1 dataset 100 visualizations"&lt;/A&gt; project, what was I supposed to do - NOT try to knockoff one of them using SAS ODS Graphics?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp;Code below (results above) inspired by&amp;nbsp;&lt;A href="https://100.datavizproject.com/data-type/viz41/" target="_self"&gt;Viz #41&lt;/A&gt;, a dot plot of a simple&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/World_Heritage_Site" target="_self"&gt;World Heritage Sites&lt;/A&gt; dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun With SAS ODS Graphics: Attempt to knockoff Viz #41 (World Heritage Sites dot plot) from Ferdio's creative "1 dataset 100 visualizations" project
  Inspired by 100.datavizproject.com/data-type/viz41 100.datavizproject.com from ferdio.com;

data viz41;                                      * Get 2004+2022 World Heritage Sites data for Norway, Denmark, Sweden; 
array countries{*} $ country1-country3;          * Array to hold 3 countries and # sites for reshaping; 
array sites{*} sites1-sites3;            
input title $80.;                                * Get description of data;
input country1-country3;                         * Grab  3 country names;
do row=1 to 2;                                   * Read rows with data for 2004 and 2022; 
  input yr sites1-sites3; 
  do col=1 to 3;                                 * And for each year/country...;                          
    country=countries{col}; 
    do y=1 to sites{col}; output; end;           * ...output one observation ("dot") for of its N sites for dot plot; 
  end;
end;                                             * Inline data from 100.datavizproject.com follows;
datalines;
     Number of World Heritage Sites
       Norway   Denmark   Sweden
2004        5         4       13    
2022        8        10       15  
;
proc sort; by yr country;                        * Sort data in ascending order by year/country;  

proc format;                                     * Country names + abbreviations;
value $countryF "Denmark"="DK" "Norway"="NO" "Sweden"="SE";

proc sgpanel data=viz41 noautolegend pad=48pt;   * Make a "dot strip" scatter plot;
panelby yr / onepanel layout=columnlattice columns=2 colheaderpos=bottom Headerattrs=(weight=bold) noborder nowall headerbackcolor=white noheaderborder novarname;
styleattrs datacontrastcolors=(red black blue);  * Contrasting colors for each country;
scatter x=country y=y / group=country markerattrs=(symbol=circlefilled size=14pt); * Plot one "dot" per site; 
colaxis display=(noticks noline nolabel) offsetmin=.25 offsetmax=.25;
rowaxis display=none offsetmin=.05 offsetmax=.05;
format country $countryF.;                       * Print country abbreviation instead of full name;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 05:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862413#M23562</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2023-03-06T05:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics: Knockoff of Viz 41 (dot plot) from "1 dataset 100 visualizations</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862460#M23563</link>
      <description>&lt;P&gt;With respect, I don't think this is a good visualization that is worthy of being reproduced. With no vertical axis, we are forced to count the number of dots if we want to know the number of sites in each country.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems like a simple bar chart is an easier and more effective presentation of these data. No doubt this is one of the "100 visualizations" that are considered.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You transposed the data from wide to long in the DATA step. I decided to use PROC TRANSPOSE, but either will work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sites;
input Year Norway   Denmark   Sweden;
datalines;
2004        5         4       13    
2022        8        10       15  
;

/* Transpose the variables from wide to long format */
proc transpose data=sites
   out=long(rename=(Col1=NumSites)) name=Country;                    
   by Year;                   /* for each subject */
   var Norway Denmark Sweden; /* make a row for these variables */
run;

title "World Heritage Sites in Scandinavia";
proc sgplot data=long;
   vbar Year / response=NumSites group=Country groupdisplay=cluster;
   label NumSites="Number of World Heritage Sites"
         Country="Country";
   xaxis display=(nolabel);
   yaxis integer grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot10.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81101iAE5DF1014EA9405C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot10.png" alt="SGPlot10.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 10:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862460#M23563</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-03-06T10:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics: Knockoff of Viz 41 (dot plot) from "1 dataset 100 visualizations</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862618#M23567</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;: Good suggestions + observations, as always. Yes, Ferdio did include some &lt;A href="https://100.datavizproject.com/data-type/viz25/" target="_self"&gt;more fully-labeled bar charts&lt;/A&gt;&amp;nbsp;in their 100-data-visualizions-on-the-wall compilation and issued a caveat suggesting Viz #41 was more about design whimsy than practicality ("A dot plot or dot chart visualizing the exact number of World Heritage sites for each year and country. No axis or labels used for simplicity, so the numbers will have to be counted manually.").&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 07:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Knockoff-of-Viz-41-dot-plot-from-quot/m-p/862618#M23567</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2023-03-07T07:05:17Z</dc:date>
    </item>
  </channel>
</rss>

