<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353</link>
    <title>MATLAB Central Newsreader - Inverting a bar chart</title>
    <description>Feed for thread: Inverting a bar chart</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>Wed, 28 Oct 2009 18:17:11 -0400</pubDate>
      <title>Inverting a bar chart</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353#690393</link>
      <author>Ryan Utz</author>
      <description>Hello all,&lt;br&gt;
&lt;br&gt;
I need to make a simple (i.e. bar(x,y)) bar chart where the y-axis is inverted, in other words, bars go down instead of up (though the values are positive), so that the graph looks like columns hanging from the ceiling. Is there any way to tell Matlab to do this? Multiplying all of my y-axis values by -1 does the trick but then the y-axis is incorrectly labeled (i.e. with negative values). &lt;br&gt;
&lt;br&gt;
Thanks for any/all help,&lt;br&gt;
Ryan</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 18:24:11 -0400</pubDate>
      <title>Re: Inverting a bar chart</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353#690395</link>
      <author>Nathan</author>
      <description>On Oct 28, 11:17&#160;am, &quot;Ryan Utz&quot; &amp;lt;r...@al.umces.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I need to make a simple (i.e. bar(x,y)) bar chart where the y-axis is inverted, in other words, bars go down instead of up (though the values are positive), so that the graph looks like columns hanging from the ceiling. Is there any way to tell Matlab to do this? Multiplying all of my y-axis values by -1 does the trick but then the y-axis is incorrectly labeled (i.e. with negative values).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for any/all help,&lt;br&gt;
&amp;gt; Ryan&lt;br&gt;
&lt;br&gt;
How about you do as you did (multiply your data set by -1), and then&lt;br&gt;
change the ticklabels accordingly?&lt;br&gt;
Ex:&lt;br&gt;
bar(-1*(1:10))&lt;br&gt;
set(gca,'yticklabel',num2str(-1*str2num(get(gca,'yticklabel'))))&lt;br&gt;
&lt;br&gt;
-Nathan</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 18:25:18 -0400</pubDate>
      <title>Re: Inverting a bar chart</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353#690396</link>
      <author>the cyclist</author>
      <description>&quot;Ryan Utz&quot; &amp;lt;rutz@al.umces.edu&amp;gt; wrote in message &amp;lt;hca1r7$ove$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I need to make a simple (i.e. bar(x,y)) bar chart where the y-axis is inverted, in other words, bars go down instead of up (though the values are positive), so that the graph looks like columns hanging from the ceiling. Is there any way to tell Matlab to do this? Multiplying all of my y-axis values by -1 does the trick but then the y-axis is incorrectly labeled (i.e. with negative values). &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for any/all help,&lt;br&gt;
&amp;gt; Ryan&lt;br&gt;
&lt;br&gt;
Not sure if this is the best way, but one way is&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; set(gca,'View',[0 -90])&lt;br&gt;
&lt;br&gt;
Normally the View property is [0 90]</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 18:20:16 -0400</pubDate>
      <title>Re: Inverting a bar chart</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353#690398</link>
      <author>dpb</author>
      <description>Ryan Utz wrote:&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I need to make a simple (i.e. bar(x,y)) bar chart where the y-axis is&lt;br&gt;
&amp;gt; inverted, in other words, bars go down instead of up (though the&lt;br&gt;
&amp;gt; values are positive), so that the graph looks like columns hanging&lt;br&gt;
&amp;gt; from the ceiling. Is there any way to tell Matlab to do this?&lt;br&gt;
&amp;gt; Multiplying all of my y-axis values by -1 does the trick but then the&lt;br&gt;
&amp;gt; y-axis is incorrectly labeled (i.e. with negative values).&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Not sure about being able to orient that way except as you did but you &lt;br&gt;
can always work around the negative y-axis labels by writing them &lt;br&gt;
explicitly as text.&lt;br&gt;
&lt;br&gt;
--</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 19:22:43 -0400</pubDate>
      <title>Re: Inverting a bar chart</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353#690418</link>
      <author>Richard Quist</author>
      <description>Ryan Utz wrote:&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I need to make a simple (i.e. bar(x,y)) bar chart where the y-axis is inverted, in other words, bars go down instead of up (though the values are positive), so that the graph looks like columns hanging from the ceiling. Is there any way to tell Matlab to do this? Multiplying all of my y-axis values by -1 does the trick but then the y-axis is incorrectly labeled (i.e. with negative values). &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for any/all help,&lt;br&gt;
&amp;gt; Ryan&lt;br&gt;
&lt;br&gt;
Assuming gca (the current axes) is the axes containing the bar plot:&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;set(gca, 'ydir', 'reverse');&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Richard Quist&lt;br&gt;
Software Developer&lt;br&gt;
The MathWorks, Inc.</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 20:36:19 -0400</pubDate>
      <title>Re: Inverting a bar chart</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264353#690446</link>
      <author>Ryan Utz</author>
      <description>Thanks! all of these work, but those suggested by Richard and dpb are the shortest</description>
    </item>
  </channel>
</rss>

