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.
|
|
0
|
|
|
|
Reply
|
drgz
|
3/12/2010 9:54:05 AM |
|
drgz wrote:
> 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.
Yes, it is _possible_ to change it, but there probably is no special
control for the length (I could figure out if there is, but it's 4 am
and I have to sleep.)
Legends in matlab are implemented by adding a second axis to the figure.
The lines and text are then placed within that axis. Find that second
axis and you can find its child line objects, and you can then change
their XData properties to change the length and positions of the lines.
Or more simply, make the axis smaller by changing its Position
properties, and then set the XLim property of the axis so that the
left-hand side of the lines are cut off. Saves you altering the
individual lines, and if you were wanting the lines shorter you were
probably wanting to change the axis Position anyhow (either because you
wanted a smaller legend box or because you wanted longer titles and it
would be a nuisance to also change the Position properties of all of the
text() objects to match a shorter line length...)
|
|
0
|
|
|
|
Reply
|
Walter
|
3/12/2010 10:06:57 AM
|
|
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.
|
|
0
|
|
|
|
Reply
|
Sadik
|
3/12/2010 12:03:05 PM
|
|
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.
|
|
0
|
|
|
|
Reply
|
Sadik
|
3/12/2010 12:09:05 PM
|
|
"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.
Thanks a lot to both of you! Hopefully there will an easier way of doing this in the future ;)
Greets!
|
|
0
|
|
|
|
Reply
|
drgz
|
3/12/2010 5:27:05 PM
|
|
|
4 Replies
923 Views
(page loaded in 0.056 seconds)
Similiar Articles: Change length of legend line sample? - comp.soft-sys.matlab ...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 ... how to set fontsize in matlab linux - comp.soft-sys.matlab ...Change length of legend line sample? - comp.soft-sys.matlab ... how to set fontsize in matlab linux - comp.soft-sys.matlab ... - MATLAB & Simulink Solution: In order to ... pick up the number in the brackets....awk way.. - comp.lang.awk ...Change length of legend line sample? - comp.soft-sys.matlab ... pick up the number in the brackets....awk way.. - comp.lang.awk ... change field separator - comp.lang.awk ... ping command with the option packetsize - comp.unix.solaris ...Change length of legend line sample? - comp.soft-sys.matlab ... ping command with the option packetsize - comp.unix.solaris ... Ping Tutorial: 15 Effective Ping Command ... Creating a Legend/Labels on a graph generated from a for loop ...I need to generate a legend and labels for each of the lines on the plot as t and r2 can change in size. I'm not very familiar with matlab functions. iterative plotting: changing color/linestyle within a loop - comp ...... d';'*';'v';'p']; lc = length(colours); ls = length(syms); for i=1:length(x ... sin(k*x), plot_types{k}, 'DisplayName', sprintf('sin(%d*x)', k)); end legend(h ... Modeling a twisted timing belt - comp.cad.solidworksJust a rectangular profile without teeth. Any help or a sample would be greatly ... any > >>>variable width between your two paths your profile will not change size ... find/replace line of code (with carriage return) - comp.soft-sys ...... delimiter','\n'); ss=repmat({''},2*size(s,1 ... There's a possibility to change these line feeds back into ... left(THISchar, 3)) c2x(THISchar) end A bit of sample ... How do I print a sample of all my fonts - comp.fontsIs there a PC utility that will print out a sample line of all the fonts I have on ... the font size is too small to read the printed hard copy. Can I just change the size to ... spline fit & 2nd derivatives - comp.soft-sys.matlabBelow some sample data of x and y form (this has been ... ppval(S1,x),'g') plot(x,ppval(S2,x),'k') legend ... how would the matrix (M=diag(3:-1:1,1)) change is if had ... Change length of legend line sample? - Newsreader - MATLAB CentralIs 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 ... Change length of legend line sample? - comp.soft-sys.matlab ...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 ... 7/21/2012 8:40:11 PM
|