<?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: Remove bar chart tick labels but not ticks in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/742696#M21526</link>
    <description>&lt;P&gt;Two different things I would look at here.&amp;nbsp; What is hopefully the easier solution is if your x-axis is being turned into a discrete axis (which it looks like).&amp;nbsp; This has the behavior with VALUES to remove the values not in the list.&amp;nbsp; From your X-axis statement it looks like you'd rather have a linear axis potentially.&amp;nbsp; If you add TYPE=LINEAR to your x-axis statement it might just make the fix with your current VALUES statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
    vbar AGE / response=height;
    xaxis type=linear values=(11 to 15 by 2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59613i6F987D2B72841492/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise if you need to keep it as a discrete axis, then it gets more tedious.&amp;nbsp; There is another option called VALUESDISPLAY where you can specify the printed value for each tick on the axis so long as they are listed in the VALUES statement.&amp;nbsp; If you have a lot of bars you would probably want to use macro language to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars;
    vbar type / response=msrp group=origin;
    xaxis values=('Hybrid' 'SUV' 'Sedan' 'Truck' 'Wagon') valuesdisplay=('Hybrid' '' 'Sedan' '' 'Wagon'); 
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59614i2E57683915D8632B/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 16:00:06 GMT</pubDate>
    <dc:creator>JeffMeyers</dc:creator>
    <dc:date>2021-05-20T16:00:06Z</dc:date>
    <item>
      <title>Remove bar chart tick labels but not ticks</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/741457#M21516</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SGPlot to plot a bar chart from a dataset that gets updated once a week with a new observation for a total number of events that week.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The x-axis is getting crowded so I'd like to display the text label for every other axis tick, but keep all the bars. I've tried using the values= option but that removes the bars as well as the tick labels. I've also tried using the FITPOLICY=thin option, which is closer to what I want as it removes tick labels but keeps the data. But that doesn't keep enough of the x axis ticks and removes the most recent tick label which is most important.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me out?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=set5 noborder noautolegend;
yaxis label = 'Number' valueattrs=(size=10pt) LABELATTRS=(size=10pt) values=(0 to 100 by 5);
xaxis label = 'Week' valueattrs=(size=7pt) LABELATTRS=(size=6pt) values=(1 to &amp;amp;max_week by 2);
vbar week / datalabel datalabelfitpolicy=none datalabelattrs=(size=8) fillattrs=(color='CX0066CC');
format week donweek.;&lt;BR /&gt;title1 h=12pt j=left "Figure 2";&lt;BR /&gt;keylegend/ title=" ";&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 May 2021 14:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/741457#M21516</guid>
      <dc:creator>RoddyJ</dc:creator>
      <dc:date>2021-05-14T14:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove bar chart tick labels but not ticks</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/741513#M21517</link>
      <description>&lt;P&gt;It is important to have a VBAR?&amp;nbsp; When x-axis tick values get busy, an HBAR can be a good alternative as there is a lot more space for each tick value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, you could split the x-axis tick values or display them slanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p07m2vpyq75fgan14m6g5pphnwlr.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p07m2vpyq75fgan14m6g5pphnwlr.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 17:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/741513#M21517</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2021-05-14T17:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Remove bar chart tick labels but not ticks</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/742696#M21526</link>
      <description>&lt;P&gt;Two different things I would look at here.&amp;nbsp; What is hopefully the easier solution is if your x-axis is being turned into a discrete axis (which it looks like).&amp;nbsp; This has the behavior with VALUES to remove the values not in the list.&amp;nbsp; From your X-axis statement it looks like you'd rather have a linear axis potentially.&amp;nbsp; If you add TYPE=LINEAR to your x-axis statement it might just make the fix with your current VALUES statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
    vbar AGE / response=height;
    xaxis type=linear values=(11 to 15 by 2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59613i6F987D2B72841492/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise if you need to keep it as a discrete axis, then it gets more tedious.&amp;nbsp; There is another option called VALUESDISPLAY where you can specify the printed value for each tick on the axis so long as they are listed in the VALUES statement.&amp;nbsp; If you have a lot of bars you would probably want to use macro language to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars;
    vbar type / response=msrp group=origin;
    xaxis values=('Hybrid' 'SUV' 'Sedan' 'Truck' 'Wagon') valuesdisplay=('Hybrid' '' 'Sedan' '' 'Wagon'); 
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59614i2E57683915D8632B/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 16:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Remove-bar-chart-tick-labels-but-not-ticks/m-p/742696#M21526</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2021-05-20T16:00:06Z</dc:date>
    </item>
  </channel>
</rss>

