Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!13g2000prl.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Inverting a bar chart
Date: Wed, 28 Oct 2009 11:24:11 -0700 (PDT)
Organization: http://groups.google.com
Lines: 20
Message-ID: <d52b2211-ac8c-48b3-a8d5-48c56eb442a5@13g2000prl.googlegroups.com>
References: <hca1r7$ove$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.33
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1256754252 5351 127.0.0.1 (28 Oct 2009 18:24:12 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 28 Oct 2009 18:24:12 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 13g2000prl.googlegroups.com; posting-host=198.206.219.33; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-Via: 1.1 wwwproxy-son-ca-01.ca.sandia.gov:80 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) 
	Gecko/20090824 Firefox/3.5.3,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:580712


On Oct 28, 11:17 am, "Ryan Utz" <r...@al.umces.edu> wrote:
> Hello all,
>
> 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).
>
> Thanks for any/all help,
> Ryan

How about you do as you did (multiply your data set by -1), and then
change the ticklabels accordingly?
Ex:
bar(-1*(1:10))
set(gca,'yticklabel',num2str(-1*str2num(get(gca,'yticklabel'))))

-Nathan