No BSD License  

Highlights from
uilineshift

4.66667

4.7 | 3 ratings Rate this file 6 Downloads (last 30 days) File Size: 21.89 KB File ID: #23899
image thumbnail

uilineshift

by paul koch

 

25 Apr 2009

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

| 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 (5)
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  
05 Feb 2010 Todd Welti

Very Nice. I disabled the x-axis by remming out lines 231,250,251,274. Since I normally plot using semilogx, the x axis shifting doesn't work well as is. An option for x or y only shift would be nice. A little display showing the current value of shift would be nice too. Very usefull as is though...

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
pick of the week Jiro Doke 11 Feb 2011 20:11:40

Contact us at files@mathworks.com