<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255227</link>
    <title>MATLAB Central Newsreader - labeling bar graphs ?</title>
    <description>Feed for thread: labeling bar graphs ?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 02 Jul 2009 22:05:03 -0400</pubDate>
      <title>labeling bar graphs ?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255227#662395</link>
      <author>Juliette Salexa</author>
      <description>If I have an array of values called A,&lt;br&gt;
and I apply the command bar(A), I get a bunch of rectangles showing me the contents of A.  &lt;br&gt;
&lt;br&gt;
Say I had another array B, who's elements were strings which I intend to use to label each of the the rectangles corresponding to the elements of A.  How can I get these strings to show up as labels for the rectangles in the bar graph, from the command line ?? &lt;br&gt;
it should only be one command .. I shouldn't have to add them manually.</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 23:18:53 -0400</pubDate>
      <title>Re: labeling bar graphs ?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255227#662402</link>
      <author>Nathan</author>
      <description>On Jul 2, 3:05&#160;pm, &quot;Juliette Salexa&quot; &amp;lt;juliette.physic...@gmail.com&amp;gt;&lt;br&gt;
wrote:&lt;br&gt;
&amp;gt; If I have an array of values called A,&lt;br&gt;
&amp;gt; and I apply the command bar(A), I get a bunch of rectangles showing me the contents of A. &#160;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Say I had another array B, who's elements were strings which I intend to use to label each of the the rectangles corresponding to the elements of A. &#160;How can I get these strings to show up as labels for the rectangles in the bar graph, from the command line ??&lt;br&gt;
&amp;gt; it should only be one command .. I shouldn't have to add them manually.&lt;br&gt;
&lt;br&gt;
well...&lt;br&gt;
How about&lt;br&gt;
A = rand(5,1);&lt;br&gt;
B = {'One';'Two';'Three';'Four';'Five'};&lt;br&gt;
bar(A);&lt;br&gt;
set(gca,'XTickLabel',B);&lt;br&gt;
&lt;br&gt;
(The set(gca,'XTickLabel',label) is your &quot;one command&quot;)&lt;br&gt;
I hope that's what you were looking for...&lt;br&gt;
-Nathan</description>
    </item>
    <item>
      <pubDate>Fri, 03 Jul 2009 20:29:02 -0400</pubDate>
      <title>Re: labeling bar graphs ?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255227#662548</link>
      <author>Juliette Salexa</author>
      <description>I knew how to do that, although not so elegantly!&lt;br&gt;
But I actually meant to have the labels on the graph itself, which I think the only way to do is manually .. although I hope there is a way!&lt;br&gt;
&lt;br&gt;
Nathan &amp;lt;ngreco32@gmail.com&amp;gt; wrote in message &amp;lt;d0209b81-628c-4366-958e-cc482c785e04@p36g2000prn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Jul 2, 3:05?pm, &quot;Juliette Salexa&quot; &amp;lt;juliette.physic...@gmail.com&amp;gt;&lt;br&gt;
&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; If I have an array of values called A,&lt;br&gt;
&amp;gt; &amp;gt; and I apply the command bar(A), I get a bunch of rectangles showing me the contents of A. ?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Say I had another array B, who's elements were strings which I intend to use to label each of the the rectangles corresponding to the elements of A. ?How can I get these strings to show up as labels for the rectangles in the bar graph, from the command line ??&lt;br&gt;
&amp;gt; &amp;gt; it should only be one command .. I shouldn't have to add them manually.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; well...&lt;br&gt;
&amp;gt; How about&lt;br&gt;
&amp;gt; A = rand(5,1);&lt;br&gt;
&amp;gt; B = {'One';'Two';'Three';'Four';'Five'};&lt;br&gt;
&amp;gt; bar(A);&lt;br&gt;
&amp;gt; set(gca,'XTickLabel',B);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (The set(gca,'XTickLabel',label) is your &quot;one command&quot;)&lt;br&gt;
&amp;gt; I hope that's what you were looking for...&lt;br&gt;
&amp;gt; -Nathan</description>
    </item>
    <item>
      <pubDate>Fri, 03 Jul 2009 21:32:01 -0400</pubDate>
      <title>Re: labeling bar graphs ?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255227#662558</link>
      <author>us</author>
      <description>&quot;Juliette Salexa&quot; &amp;lt;juliette.physicist@gmail.com&amp;gt; wrote in message &amp;lt;h2lpme$ds2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I knew how to do that, although not so elegantly!&lt;br&gt;
&amp;gt; But I actually meant to have the labels on the graph itself, which I think the only way to do is manually .. although I hope there is a way!&lt;br&gt;
&lt;br&gt;
a hint:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;help text;&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
  </channel>
</rss>

