<?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: gplot: displaying missing categories as 0 in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67883#M2347</link>
    <description>Certainly! - That would be the very basic line plots - described in more detail in the doc - you've checked there first, right? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
All you'd have to do is modify the symbol statement in the above example, as follows:&lt;BR /&gt;
&lt;BR /&gt;
data test; &lt;BR /&gt;
input month count ; &lt;BR /&gt;
cards; &lt;BR /&gt;
1 10 &lt;BR /&gt;
2 20 &lt;BR /&gt;
4 19 &lt;BR /&gt;
5 5 &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=dot height=2 interpol=join;&lt;BR /&gt;
axis1 order=(1 to 5 by 1) minor=none offset=(5,5);&lt;BR /&gt;
axis2 order=(0 to 25 by 5) minor=none offset=(0,0);&lt;BR /&gt;
proc gplot data=test; &lt;BR /&gt;
plot count*month=1 / haxis=axis1 vaxis=axis2;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Or, if you want to have a "gap" in the line plot, where the value at 3 is missing, then insert a SAS "missing value" in the data, and use the 'skipmiss' gplot option...&lt;BR /&gt;
&lt;BR /&gt;
data test; &lt;BR /&gt;
input month count ; &lt;BR /&gt;
cards; &lt;BR /&gt;
1 10 &lt;BR /&gt;
2 20 &lt;BR /&gt;
3 .&lt;BR /&gt;
4 19 &lt;BR /&gt;
5 5 &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=dot height=2 interpol=join;&lt;BR /&gt;
axis1 order=(1 to 5 by 1) minor=none offset=(5,5);&lt;BR /&gt;
axis2 order=(0 to 25 by 5) minor=none offset=(0,0);&lt;BR /&gt;
proc gplot data=test; &lt;BR /&gt;
plot count*month=1 / haxis=axis1 vaxis=axis2 skipmiss;&lt;BR /&gt;
run; &lt;BR /&gt;
proc print data=test; run;</description>
    <pubDate>Mon, 30 Aug 2010 17:16:47 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2010-08-30T17:16:47Z</dc:date>
    <item>
      <title>gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67879#M2343</link>
      <description>I have data that looks like this:&lt;BR /&gt;
month count&lt;BR /&gt;
1  10&lt;BR /&gt;
2  20&lt;BR /&gt;
4  19&lt;BR /&gt;
5    5&lt;BR /&gt;
&lt;BR /&gt;
How do I plot month=3 as count=0?&lt;BR /&gt;
&lt;BR /&gt;
Thank you.</description>
      <pubDate>Fri, 27 Aug 2010 20:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67879#M2343</guid>
      <dc:creator>gzr2mz39</dc:creator>
      <dc:date>2010-08-27T20:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67880#M2344</link>
      <description>data test;                                                                                                                              &lt;BR /&gt;
input month count ;                                                                                                                     &lt;BR /&gt;
cards;                                                                                                                                  &lt;BR /&gt;
1 10                                                                                                                                    &lt;BR /&gt;
2 20                                                                                                                                    &lt;BR /&gt;
3 0                                                                                                                                     &lt;BR /&gt;
4 19                                                                                                                                    &lt;BR /&gt;
5 5                                                                                                                                     &lt;BR /&gt;
 ;                                                                                                                                      &lt;BR /&gt;
goptions dev=win;                                                                                                                       &lt;BR /&gt;
proc gchart;                                                                                                                            &lt;BR /&gt;
vbar month/sumvar=count                                                                                                                 &lt;BR /&gt;
           discrete                                                                                                                     &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
;                                                                                                                                       &lt;BR /&gt;
run;</description>
      <pubDate>Mon, 30 Aug 2010 15:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67880#M2344</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2010-08-30T15:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67881#M2345</link>
      <description>Or, without inserting data, you could use a gplot needle plot (which used a proportional axis, rather than only plotting bars for the points you have data at), such as ...&lt;BR /&gt;
&lt;BR /&gt;
data test; &lt;BR /&gt;
input month count ; &lt;BR /&gt;
cards; &lt;BR /&gt;
1 10 &lt;BR /&gt;
2 20 &lt;BR /&gt;
4 19 &lt;BR /&gt;
5 5 &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=none interpol=needle width=15;&lt;BR /&gt;
axis1 order=(1 to 5 by 1) minor=none offset=(5,5);&lt;BR /&gt;
axis2 order=(0 to 25 by 5) minor=none offset=(0,0);&lt;BR /&gt;
proc gplot data=test; &lt;BR /&gt;
plot count*month=1 / haxis=axis1 vaxis=axis2;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 30 Aug 2010 15:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67881#M2345</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-08-30T15:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67882#M2346</link>
      <description>This looks good.&lt;BR /&gt;
Is it possible to use lines instead of bars?&lt;BR /&gt;
Thank you.</description>
      <pubDate>Mon, 30 Aug 2010 16:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67882#M2346</guid>
      <dc:creator>gzr2mz39</dc:creator>
      <dc:date>2010-08-30T16:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67883#M2347</link>
      <description>Certainly! - That would be the very basic line plots - described in more detail in the doc - you've checked there first, right? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
All you'd have to do is modify the symbol statement in the above example, as follows:&lt;BR /&gt;
&lt;BR /&gt;
data test; &lt;BR /&gt;
input month count ; &lt;BR /&gt;
cards; &lt;BR /&gt;
1 10 &lt;BR /&gt;
2 20 &lt;BR /&gt;
4 19 &lt;BR /&gt;
5 5 &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=dot height=2 interpol=join;&lt;BR /&gt;
axis1 order=(1 to 5 by 1) minor=none offset=(5,5);&lt;BR /&gt;
axis2 order=(0 to 25 by 5) minor=none offset=(0,0);&lt;BR /&gt;
proc gplot data=test; &lt;BR /&gt;
plot count*month=1 / haxis=axis1 vaxis=axis2;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Or, if you want to have a "gap" in the line plot, where the value at 3 is missing, then insert a SAS "missing value" in the data, and use the 'skipmiss' gplot option...&lt;BR /&gt;
&lt;BR /&gt;
data test; &lt;BR /&gt;
input month count ; &lt;BR /&gt;
cards; &lt;BR /&gt;
1 10 &lt;BR /&gt;
2 20 &lt;BR /&gt;
3 .&lt;BR /&gt;
4 19 &lt;BR /&gt;
5 5 &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=dot height=2 interpol=join;&lt;BR /&gt;
axis1 order=(1 to 5 by 1) minor=none offset=(5,5);&lt;BR /&gt;
axis2 order=(0 to 25 by 5) minor=none offset=(0,0);&lt;BR /&gt;
proc gplot data=test; &lt;BR /&gt;
plot count*month=1 / haxis=axis1 vaxis=axis2 skipmiss;&lt;BR /&gt;
run; &lt;BR /&gt;
proc print data=test; run;</description>
      <pubDate>Mon, 30 Aug 2010 17:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67883#M2347</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-08-30T17:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67884#M2348</link>
      <description>I liked how the needle plot reflected count=0.&lt;BR /&gt;
I was hoping there was a better way to reflect count=0 with the line plot (ie the line actually goes down to 0 instead of just not display a dot).</description>
      <pubDate>Mon, 30 Aug 2010 17:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67884#M2348</guid>
      <dc:creator>gzr2mz39</dc:creator>
      <dc:date>2010-08-30T17:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: gplot: displaying missing categories as 0</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67885#M2349</link>
      <description>To do that, you'd have to insert a zero value into the data...&lt;BR /&gt;
&lt;BR /&gt;
data test; &lt;BR /&gt;
input month count ; &lt;BR /&gt;
cards; &lt;BR /&gt;
1 10 &lt;BR /&gt;
2 20 &lt;BR /&gt;
3 0&lt;BR /&gt;
4 19 &lt;BR /&gt;
5 5 &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=dot height=2 interpol=join;&lt;BR /&gt;
axis1 order=(1 to 5 by 1) minor=none offset=(5,5);&lt;BR /&gt;
axis2 order=(0 to 25 by 5) minor=none offset=(0,0);&lt;BR /&gt;
proc gplot data=test; &lt;BR /&gt;
plot count*month=1 / haxis=axis1 vaxis=axis2;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 30 Aug 2010 17:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gplot-displaying-missing-categories-as-0/m-p/67885#M2349</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-08-30T17:54:14Z</dc:date>
    </item>
  </channel>
</rss>

