Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Change length of legend line sample?
Date: Fri, 12 Mar 2010 12:09:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <hndat1$pmu$1@fred.mathworks.com>
References: <hnd2vt$6r$1@fred.mathworks.com> <hndahp$3ij$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1268395745 26334 172.30.248.35 (12 Mar 2010 12:09:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 12 Mar 2010 12:09:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:616231

I am sorry, it seems that my message did not show up for some reason. I am writing again:

An example:

plot(1:10)
legend('a')
linesInPlot = findobj('type','line'); % linesInPlot(2) is the handle to that line
get(linesInPlot(2),'XData') % returns 0.1231    0.7385
set(linesInPlot(2),'XData',[0.1231 0.4]) % so that new length < 0.5*previous

Best.




"Sadik " <sadik.hava@gmail.com> wrote in message <hndahp$3ij$1@fred.mathworks.com>...
> By the way, I am using Matlab 7, so you had better check if it is really the second element of linesInPlot, that is if the handle is given by linesInPlot(2).
> 
> 
> "drgz " <syrehue@hotmail.com> wrote in message <hnd2vt$6r$1@fred.mathworks.com>...
> > Is there any way in MATLAB to reduce the length of the line sample, as it is with i.e. Gnuplot (set key samplen 'sample length')?
> > 
> > When I search in the product help I find examples for changing almost everything else, but can't find anything about this.