Path: news.mathworks.com!not-for-mail
From: "Sven " <sven.holcombe@gmail.deleteme.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Can one put text lables on a plot axis?
Date: Fri, 28 Mar 2008 08:41:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <fsiav1$3mr$1@fred.mathworks.com>
References: <fsi8ea$9tr$1@fred.mathworks.com>
Reply-To: "Sven " <sven.holcombe@gmail.deleteme.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1206693665 3803 172.30.248.37 (28 Mar 2008 08:41:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 28 Mar 2008 08:41:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1326470
Xref: news.mathworks.com comp.soft-sys.matlab:459617


"Daniel Armyr" <firstname@lastname.se> wrote in message
<fsi8ea$9tr$1@fred.mathworks.com>...
> Hi.
> I am working on a report and I have some tada that I would
> like to pot as a curve. The problem is that my X axis isn't
> a parameter that takes numerical values, but a list of
> components with names. 
> 
> Does anyone know if I can make a plot and exchange the
> x-axis markings with custom labels?
> 
> Sincerely
> --DA
> 

Hi Daniel, try this:

ydata = [55:60]
xdata = 1:length(ydata)
xlabels = {'Jan','Feb','Mar','anything','you','like'}
figure
plot(xdata, ydata, '.b-')
set(gca, 'Xtick', xdata, 'XtickLabel', xlabels)

Cheers,
Sven.