<?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: Sgplot: vbar xaxis values in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/543394#M17905</link>
    <description>&lt;P&gt;Hi, I was running into a similar issue recently, in which I need to &lt;STRONG&gt;hide&lt;/STRONG&gt; some of the x axis values in my graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I used &lt;STRONG&gt;values=()&lt;/STRONG&gt; option in the xaxis statement, but it &lt;STRONG&gt;did not&lt;/STRONG&gt; work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, in the documentation, I find&amp;nbsp;&lt;STRONG&gt;fitpolicy=thin&lt;/STRONG&gt; option in the xaxis statement and get the result I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back to your issue, I think you did not have any obs with values other than &lt;STRONG&gt;0 8 10&lt;/STRONG&gt; of variable &lt;STRONG&gt;day &lt;/STRONG&gt;in your dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Such as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tmp;
	input day organism;
	cards;
	0 1
	8 1
	10 1
	;
run;

proc sgplot data=tmp noautolegend;
	vbar day/response=organism nooutline stat=freq barwidth=0.3 transparency=0;
	xaxis label="Study Day";
	yaxis values=(0 to 8 by 1);
	title1 "VE303 Detection panel-Stacked bar charts";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Which generates plot like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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-center" image-alt="SGPlot45.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27950i910E9D70F276E84E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot45.png" alt="SGPlot45.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus you&amp;nbsp;might create additional obs with values 1 to 7, and 9 (those you want to display on the x axis) of variable &lt;STRONG&gt;day&lt;/STRONG&gt; with &lt;EM&gt;missing values&lt;/EM&gt; of &lt;STRONG&gt;organism&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tmp;
	input day organism;
	cards;
	0 1
	8 1
	10 1
	1 .
	2 .
	3 .
	4 .
	5 .
	6 .
	7 .
	9 .
	;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then, rerun the same code, and you will get the result you want as follows &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SGPlot43.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27949iBCE759D762CA2FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot43.png" alt="SGPlot43.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2019 12:54:21 GMT</pubDate>
    <dc:creator>GFW</dc:creator>
    <dc:date>2019-08-08T12:54:21Z</dc:date>
    <item>
      <title>Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459492#M15843</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20352iC40F18C8FAD20DCD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am having issue with proc sgplot xaxis values. here is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods pdf file="R:\\14.1.4.pdf";&lt;/P&gt;&lt;P&gt;proc sgplot data=count dAttrMap=attrmap ;&lt;BR /&gt;by cohort subject;&lt;BR /&gt;/* The ATTRID option references the name of the attribute map */&lt;BR /&gt;vbar day / group=organism grouporder=ascending attrid=organism barwidth=0.3 ;&lt;BR /&gt;&lt;BR /&gt;xaxis label="Study Day"&amp;nbsp; &lt;SPAN&gt;values=(0 to 8 by 1)&lt;/SPAN&gt;;&lt;BR /&gt;yaxis values=(0 to 8 by 1);&lt;BR /&gt;format day dy.;&lt;BR /&gt;title1 "VE303 Detection panel-Stacked bar charts";&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;ods pdf close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;when i got the output it is not&amp;nbsp;taking from 0 to 8 by 1.&lt;/P&gt;&lt;P&gt;please help to get the xaxis values as mentioned . look at the output picture on top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 18:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459492#M15843</guid>
      <dc:creator>Anushavalli</dc:creator>
      <dc:date>2018-05-03T18:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459504#M15845</link>
      <description>&lt;P&gt;What does the log show?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207947"&gt;@Anushavalli&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am having issue with proc sgplot xaxis values. here is my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods pdf file="R:\\14.1.4.pdf";&lt;/P&gt;
&lt;P&gt;proc sgplot data=count dAttrMap=attrmap ;&lt;BR /&gt;by cohort subject;&lt;BR /&gt;/* The ATTRID option references the name of the attribute map */&lt;BR /&gt;vbar day / group=organism grouporder=ascending attrid=organism barwidth=0.3 ;&lt;BR /&gt;&lt;BR /&gt;xaxis label="Study Day"&amp;nbsp; &lt;SPAN&gt;values=(0 to 8 by 1)&lt;/SPAN&gt;;&lt;BR /&gt;yaxis values=(0 to 8 by 1);&lt;BR /&gt;format day dy.;&lt;BR /&gt;title1 "VE303 Detection panel-Stacked bar charts";&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;ods pdf close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;when i got the output it is not&amp;nbsp;taking from 0 to 8 by 1.&lt;/P&gt;
&lt;P&gt;please help to get the xaxis values as mentioned .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 22:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459504#M15845</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-02T22:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459508#M15848</link>
      <description>&lt;P&gt;You say&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;when i got the output it is not&amp;nbsp;taking from 0 to 8 by 1&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So what is it showing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be a good idea to insert a picture of your result so we can see what you are getting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or Provide example data in the form of&amp;nbsp;data step code&amp;nbsp;so we can run the program with that data to see.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 23:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459508#M15848</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-02T23:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459539#M15850</link>
      <description>&lt;P&gt;please post your log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a quick alternative, you could simply use a WHERE Statement.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 05:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459539#M15850</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-05-03T05:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459784#M15859</link>
      <description>&lt;P&gt;updated with output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 18:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459784#M15859</guid>
      <dc:creator>Anushavalli</dc:creator>
      <dc:date>2018-05-03T18:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459790#M15860</link>
      <description>&lt;P&gt;The VBAR x-axis is considered discrete by default.&amp;nbsp; Since you did not provide data, it is not clear if&amp;nbsp;the "day" variable is numeric or character.&amp;nbsp; &amp;nbsp;If "Day" is numeric, providing a VALUES option with linear data should still work.&amp;nbsp; These would be in data range, not indexes.&amp;nbsp; If "Day" is numeric, you can also make the x-axis TYPE=LINEAR.&amp;nbsp; Else, you can provide the values you want as quoted character values.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 18:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459790#M15860</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-05-03T18:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459801#M15861</link>
      <description>&lt;P&gt;Day variable is Numeric even though values statement is not working out .if i give TYPE=LINEAR then pdf is not generating the vbars.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 18:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459801#M15861</guid>
      <dc:creator>Anushavalli</dc:creator>
      <dc:date>2018-05-03T18:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459803#M15862</link>
      <description>log does not have any warnings or errors..&lt;BR /&gt;can you please let me know exact place to apply WHERE statement.</description>
      <pubDate>Thu, 03 May 2018 18:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/459803#M15862</guid>
      <dc:creator>Anushavalli</dc:creator>
      <dc:date>2018-05-03T18:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot: vbar xaxis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/543394#M17905</link>
      <description>&lt;P&gt;Hi, I was running into a similar issue recently, in which I need to &lt;STRONG&gt;hide&lt;/STRONG&gt; some of the x axis values in my graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I used &lt;STRONG&gt;values=()&lt;/STRONG&gt; option in the xaxis statement, but it &lt;STRONG&gt;did not&lt;/STRONG&gt; work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, in the documentation, I find&amp;nbsp;&lt;STRONG&gt;fitpolicy=thin&lt;/STRONG&gt; option in the xaxis statement and get the result I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back to your issue, I think you did not have any obs with values other than &lt;STRONG&gt;0 8 10&lt;/STRONG&gt; of variable &lt;STRONG&gt;day &lt;/STRONG&gt;in your dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Such as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tmp;
	input day organism;
	cards;
	0 1
	8 1
	10 1
	;
run;

proc sgplot data=tmp noautolegend;
	vbar day/response=organism nooutline stat=freq barwidth=0.3 transparency=0;
	xaxis label="Study Day";
	yaxis values=(0 to 8 by 1);
	title1 "VE303 Detection panel-Stacked bar charts";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Which generates plot like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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-center" image-alt="SGPlot45.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27950i910E9D70F276E84E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot45.png" alt="SGPlot45.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus you&amp;nbsp;might create additional obs with values 1 to 7, and 9 (those you want to display on the x axis) of variable &lt;STRONG&gt;day&lt;/STRONG&gt; with &lt;EM&gt;missing values&lt;/EM&gt; of &lt;STRONG&gt;organism&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tmp;
	input day organism;
	cards;
	0 1
	8 1
	10 1
	1 .
	2 .
	3 .
	4 .
	5 .
	6 .
	7 .
	9 .
	;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then, rerun the same code, and you will get the result you want as follows &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SGPlot43.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27949iBCE759D762CA2FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot43.png" alt="SGPlot43.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 12:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-vbar-xaxis-values/m-p/543394#M17905</guid>
      <dc:creator>GFW</dc:creator>
      <dc:date>2019-08-08T12:54:21Z</dc:date>
    </item>
  </channel>
</rss>

