<?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 Histograms: y-axis on both sides and labelling of x-axis points in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75692#M2812</link>
    <description>I'm facing two issues in plotting histograms in gchart, if anyone could advise please?&lt;BR /&gt;
&lt;BR /&gt;
1) How to display y-axis on both the sides of the graph, one side displaying frequencies and the other side displaying percentages?&lt;BR /&gt;
&lt;BR /&gt;
2)On the x-axis, how to label the bars only after (say) 5 points and yet display all the bars? For instance, how to have a bar for each point from 0 to 80 (0,1,2..80) and display the labels for bars only at (0, 5, 10...80)?&lt;BR /&gt;
&lt;BR /&gt;
I tried in proc univariate as well but couldn't work it out. Thanks.&lt;BR /&gt;
Vikas</description>
    <pubDate>Tue, 20 Apr 2010 12:30:37 GMT</pubDate>
    <dc:creator>VD</dc:creator>
    <dc:date>2010-04-20T12:30:37Z</dc:date>
    <item>
      <title>Histograms: y-axis on both sides and labelling of x-axis points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75692#M2812</link>
      <description>I'm facing two issues in plotting histograms in gchart, if anyone could advise please?&lt;BR /&gt;
&lt;BR /&gt;
1) How to display y-axis on both the sides of the graph, one side displaying frequencies and the other side displaying percentages?&lt;BR /&gt;
&lt;BR /&gt;
2)On the x-axis, how to label the bars only after (say) 5 points and yet display all the bars? For instance, how to have a bar for each point from 0 to 80 (0,1,2..80) and display the labels for bars only at (0, 5, 10...80)?&lt;BR /&gt;
&lt;BR /&gt;
I tried in proc univariate as well but couldn't work it out. Thanks.&lt;BR /&gt;
Vikas</description>
      <pubDate>Tue, 20 Apr 2010 12:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75692#M2812</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2010-04-20T12:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms: y-axis on both sides and labelling of x-axis points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75693#M2813</link>
      <description>The easiest way to get an axis on the left &amp;amp; right side of a bar chart is using "proc gbarline".  If your version of SAS is not new enough to have gbarline, then you could use "proc gchart" and then annotate the tickmarks &amp;amp; values along the right-side of the graph (a little tricky, but do-able).&lt;BR /&gt;
&lt;BR /&gt;
Here's some basic gbarline code, to get you started:&lt;BR /&gt;
&lt;BR /&gt;
data foo;&lt;BR /&gt;
input barnum value pct;&lt;BR /&gt;
format pct percent5.0;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2 .20&lt;BR /&gt;
2 5 .50&lt;BR /&gt;
3 3 .30&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
symbol1 value=none interpol=none;&lt;BR /&gt;
proc gbarline data=foo;&lt;BR /&gt;
bar barnum / type=sum sumvar=value;&lt;BR /&gt;
plot / sumvar=pct;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 20 Apr 2010 12:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75693#M2813</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-04-20T12:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms: y-axis on both sides and labelling of x-axis points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75694#M2814</link>
      <description>Per your 2nd question - you can use an axis statement with "proc gchart", and it will let you specify custom text (including a blank value) for each tickmark value of the axis, referring to them by number ( t=1 is the first bar midpoint value, t=2 is the second, and so on).&lt;BR /&gt;
&lt;BR /&gt;
Here is some sample code, that shows how to blank out the first 5 values:&lt;BR /&gt;
&lt;BR /&gt;
axis1 value=(t=1 '' t=2 '' t=3 '' t=4 '' t=5 '');&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=sashelp.class;&lt;BR /&gt;
hbar name / type=sum sumvar=height maxis=axis1;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 20 Apr 2010 12:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75694#M2814</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-04-20T12:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms: y-axis on both sides and labelling of x-axis points</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75695#M2815</link>
      <description>Robert, this is very helpful. Thanks for both the answers. Vikas.</description>
      <pubDate>Tue, 20 Apr 2010 12:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Histograms-y-axis-on-both-sides-and-labelling-of-x-axis-points/m-p/75695#M2815</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2010-04-20T12:54:41Z</dc:date>
    </item>
  </channel>
</rss>

