DRAGPLOT allows plotted lines to be dragged from one figure window and dropped into another. This is convenient when you desire to compare the results of multiple programs and you haven't taken the time or trouble to save data, recall it, and issue custom plot commands.
Lines can be moved or copied from one figure to another, or can be deleted, all using common drag 'n drop operations.
Mark Brown (2021). DRAGPLOT (https://www.mathworks.com/matlabcentral/fileexchange/3678-dragplot), MATLAB Central File Exchange. Retrieved .
very useful program, thank you.
PointerWindow Fix for HG2:
replace line 42 with
'try, f=get(0,''PointerWindow'');catch, f = matlab.ui.internal.getPointerWindow; end;',...
The new graphics objects in R2014b eliminated the "pointerwindow" property of the root object, so this program no longer works. No known workarounds.
For some reason, this function does not work any more in R2014b but it was very useful. Any idea on how to fix things?
Very useful program, thanks.
Thanks for this brilliant idea, one improvement could be allowing drop to an axes within the same figure, I have implemented that and used at my work, thanks again.
To answer DJM's question, that may be intended behavior! If you drop a line anywhere except over a valid axis, that line object will be deleted. That's intentional. If you want to copy a line object, hold down the CTRL key when you drag and drop.
Worked with no problems on a simple test. I only had one case where placement messed up, all the selected data points moved off the plot and I couldn't bring them back. I wonder what a good test case for that is...
The link in Norbert's comment above seems to be broken. Can somone give the updated link?
This is an excellent trick which proves to be highly useful. I used to wonder why Mathworks hadn't implemented this functionality. I had to overcome this from command-line before I knew that Mark Brown solved the problem.
This is really cool, and quite useful. It sure beats printing two pages, stacking them on top of each other, and holding them up to a bright light!
I would like to suggest to look at the INCA tool, available in the File Exchange area: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2387
which has some more functionality. Furthermore, its functionality can be added to the menubar.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!