Path: news.mathworks.com!not-for-mail
From: "Miroslav Balda" <miroslav.nospam@balda.cz>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linewidth control
Date: Mon, 16 Mar 2009 19:11:01 +0000 (UTC)
Organization: Miroslav Balda
Lines: 19
Message-ID: <gpm885$s28$1@fred.mathworks.com>
References: <gpkcqt$9n5$1@fred.mathworks.com>
Reply-To: "Miroslav Balda" <miroslav.nospam@balda.cz>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237230661 28744 172.30.248.35 (16 Mar 2009 19:11:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 16 Mar 2009 19:11:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 360709
Xref: news.mathworks.com comp.soft-sys.matlab:525322


"Godzilla " <godzilla@tokyo.edu> wrote in message <gpkcqt$9n5$1@fred.mathworks.com>...
> Is it possible to more accurately control the linewidth of a plotted line? 
> 
> I would really like to scale the width of the line to some fraction of the x-axis tick marks.   For example, my ticks are 1-second spacing and I want draw a line whose width corresponds to 100 msec.  

Hi,
One solution is here:

lw = 0.1;     %   linewidth in seconds
set(gca,'Units','pixels');
xlim = get(gca,'XLim');
dt = xlim(2)-xlim(1);          % displayed time in seconds
pos = get(gca,'Position');
w = (pos(3)-pos(1))/dx*lw;
plot(t,fun(t),'Linewidth',w);

Hope it hepls.

Mira