4.66667

4.7 | 3 ratings Rate this file 42 downloads (last 30 days) File Size: 21.89 KB File ID: #23899

uilineshift

by paul koch

 

25 Apr 2009

No BSD License  

function to shift a selected line (or all other outputs of the PLOT-function) in X and Y-direction

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

 this function might be useful for quick and dirty visual inspection of multiple traces or timecourses with a timedelay between or arbitrary x/y-axes or illconditioned overlay of traces
 - works for all outputs of the 'plot-function' (type is 'line').
- Note, plotet dots are also of type line.
 - The function adds an icon in the menubar of a figure, which than
   activates the shift-function
 - if the function is active, a line can be selected and moved within the axis as long as the
    mousebutton is not released
 - right mouse button (contextmenu): get the original plot (as long as the icon in the menubar is
   not deactivated)
=====================
HOW TO DO:
1]
plot(something);%plot something
uilineshift; %adds icon in menubar
OR 2]
uilineshift; %adds icon in menubar
now plot something
=====================
EXAMPLE:
  uilineshift('test'); %3 examples
----------------------------------------------------------------------
                    Paul S. Koch, BNIC Berlin 2009
----------------------------------------------------------------------

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
12 Jun 2009 Bryan

Extremely useful. I don't know how many times I have had to do this manually.

It would be nice if this worked for simulink scopes.

12 Jun 2009 Bryan

I thought is would be useful to show the difference between the current line and the original lines. This would be useful if you are trying to find a offset value for instance. If you add this after line 248 or so then the difference will display in the command window:

x_diff = s.x(1)-s.xorig(1);
y_diff = s.y(1)-s.yorig(1);
disp(['New Location Difference: x: ',num2str(x_diff), ' y: ',num2str(y_diff)])

This was a quick and dirty way to get the difference. Better yet the difference would display on the plot somehow.

12 Jun 2009 Andrew Scott

Nice, but the demo requires "hanning", which is a signal processing toolbox function.

12 Jun 2009 Matthew  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
image processing paul koch 27 Apr 2009 11:01:26
gui paul koch 27 Apr 2009 11:01:26
plot Bryan 12 Jun 2009 08:29:50
potw Shari Freedman 12 Jun 2009 15:08:49
image processing Curtis 08 Oct 2009 08:54:44
gui Curtis 08 Oct 2009 08:54:52
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com