Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Suppress Plot Unit Modifiers
Date: Sat, 29 Mar 2008 18:40:18 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 20
Message-ID: <fsm2ei$t34$1@canopus.cc.umanitoba.ca>
References: <fsluas$gr0$1@fred.mathworks.com> <fsm03g$pp6$1@canopus.cc.umanitoba.ca> <fsm1hv$dhm$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1206816018 29796 192.70.172.160 (29 Mar 2008 18:40:18 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Sat, 29 Mar 2008 18:40:18 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:459842



In article <fsm1hv$dhm$1@fred.mathworks.com>,
David Doria <daviddoria@gmail.com> wrote:
>in this example:

>x=1:1e5;
>y=x.^2;
>plot(x,y)
>set(gca,'XTickLabel',num2str(get(gca,'XTick').'))

>the axis labels become the actual values (ie 90000, etc).

>Is there a way to extract the multiplier so you can divide
>by it and get just 9, etc. 

xticks = get(gca,'XTick').';
pow10 = 10^floor(log10(min(xticks(:))));
set(gca,'XTickLabel',num2str(xticks ./ pow10));
-- 
   "Any sufficiently advanced bug is indistinguishable from a feature."
   -- Rich Kulawiec