<?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: PROC SGPLOT: Set x axis interval to months while keeping vbar data by day. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227606#M8249</link>
    <description>&lt;P&gt;If you really really need SGPLOT&amp;nbsp;to summarize the data by day, you need to use VBAR. &amp;nbsp;Then the x- axis will be discrete, and the axis will try to show each value, thinned by collisions. &amp;nbsp;To avoid this you will need a format to make the non- labeled values to blank. &amp;nbsp;Setting the VALUES option will subset axis range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can summarize the data by day prior to SGPLOT, using MEANS, you can use a needle plot with a real time axis. &amp;nbsp;Then, you can set the values as mentioned above. &amp;nbsp;You could also use a HIGHLOW plot to get a bar like feel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With&amp;nbsp;SAS 9.40M3, you have best of both worlds, and you can use VBAR with a linear axis by setting XAXIS TYPE=Linear;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2015 05:12:59 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2015-09-29T05:12:59Z</dc:date>
    <item>
      <title>PROC SGPLOT: Set x axis interval to months while keeping vbar data by day.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227491#M8243</link>
      <description>&lt;P&gt;I am graphing number of cases by day over a year period.&amp;nbsp;I want to keep my bar graph by day but group the axis labels by month. I've tried but each time it groups my data by month also. Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My graph code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=byyear;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vbar date/ response=count_2014 legendlabel="2014" fillattrs= (color=green);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xaxis label= "Date" &amp;nbsp;valueattrs= (size=16pt)labelattrs=(size=20pt) interval=month;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yaxis label="Number of Cases" values=(0 to 15 by 1) valueattrs= (size=16pt)labelattrs=(size=20pt);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this option, but no luck:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;values=(1 to 365 by month) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * date data is in julday3. format&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 14:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227491#M8243</guid>
      <dc:creator>mh3477</dc:creator>
      <dc:date>2015-09-28T14:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT: Set x axis interval to months while keeping vbar data by day.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227496#M8244</link>
      <description>&lt;P&gt;You don't mention the range of dates you need but adding to the xaxis statement&lt;/P&gt;&lt;P&gt;values=("01JAN2014"d to "01DEC2014" by month)&lt;/P&gt;&lt;P&gt;would put labels at the start of each month.&lt;/P&gt;&lt;P&gt;The date litterals are in the that form, you can't use 01/01/2014 or similar and the variable for the xaxis has to be a SAS date value.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 14:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227496#M8244</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-28T14:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT: Set x axis interval to months while keeping vbar data by day.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227506#M8245</link>
      <description>&lt;P&gt;You may want to try adding variable MONTH to your data with a format something like MONYY5.&amp;nbsp; Once you do that you can drop the X axis and use a BOX plot.&amp;nbsp; It might look something like&lt;/P&gt;&lt;P&gt;FORMAT month MONYY5. ;&lt;/P&gt;&lt;P&gt;BLOCK X=month BLOCK=month /&lt;/P&gt;&lt;P&gt;NOLABEL POSITION=BOTTOM FILLTYPE=ALTERNATE;&lt;/P&gt;&lt;P&gt;XAXIS DISPLAY=NONE;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Jim Horne&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 14:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227506#M8245</guid>
      <dc:creator>jimhorne</dc:creator>
      <dc:date>2015-09-28T14:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT: Set x axis interval to months while keeping vbar data by day.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227544#M8247</link>
      <description>thanks, but when i use the values option values=(a to b by c) is changes my data and groups it by month. So for example, instead of having 365 bars there are only 12. I want 365 bars but only 12 ticks on my x axis.</description>
      <pubDate>Mon, 28 Sep 2015 17:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227544#M8247</guid>
      <dc:creator>mh3477</dc:creator>
      <dc:date>2015-09-28T17:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT: Set x axis interval to months while keeping vbar data by day.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227606#M8249</link>
      <description>&lt;P&gt;If you really really need SGPLOT&amp;nbsp;to summarize the data by day, you need to use VBAR. &amp;nbsp;Then the x- axis will be discrete, and the axis will try to show each value, thinned by collisions. &amp;nbsp;To avoid this you will need a format to make the non- labeled values to blank. &amp;nbsp;Setting the VALUES option will subset axis range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can summarize the data by day prior to SGPLOT, using MEANS, you can use a needle plot with a real time axis. &amp;nbsp;Then, you can set the values as mentioned above. &amp;nbsp;You could also use a HIGHLOW plot to get a bar like feel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With&amp;nbsp;SAS 9.40M3, you have best of both worlds, and you can use VBAR with a linear axis by setting XAXIS TYPE=Linear;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 05:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Set-x-axis-interval-to-months-while-keeping-vbar/m-p/227606#M8249</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-09-29T05:12:59Z</dc:date>
    </item>
  </channel>
</rss>

