MATLAB: How to move an object from one plot to another inside a GUI using GUIDE move object within plots Hi , I would like to move an object from one plot to another plot within the same GUI which I have created using GUIDE. Can anyone help me please. Thanks Vivekram Best Answer Vivekram, you can change any handle graphics "Parent" property. Here's a fully working example:function F = tmpfunc() F = figure; ax1 = subplot(1,2,1); axis([0 10 0 1]) ax2 = subplot(1,2,2); axis([0 10 0 1]) plotH = plot(ax1,rand(10,1),'.r-'); uicontrol(F, 'String','Push Me', 'Position', [0 0 100 30],'Callback',@push_callback) function push_callback(src,evnt) currentParent = get(plotH,'Parent'); if currentParent==ax1 newParent=ax2; else newParent=ax1; end set(plotH,'Parent',newParent) end endSee the set() call at the end there? All it takes is the handle of the thing you want to move, and the handle of the thing you want to move it to.Does this help answer your question? Related SolutionsMATLAB: Error using handle.handle/set Invalid or deleted object. In your callback for edit1 you replace the handle with the value extracted from the handle. That is confusing at the very least. MATLAB: Plotting data in gui axes(handles.axes1)Notice you had handle instead of handles Related QuestionCan anyone fix this issueHow to extract data from a selected file by pressing a push button in GUI
Best Answer