How can I add "Edit plot" to tool bar in my own GUI
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi ! I would like to create a GUI with and axes. Axes should have zoom in, zoom out, rotate , pan and normal white arrow which is "Edit plot". To get four this feauters it is enough to click GUIDE "Tollbar Editor" and just add zoom in, pan etc. BUT there is nothing like normal white arrow "Edit plot".I don't want to have all "edit plot" toolbar. I just have interactive plot (user can change position of the point) and I would like user to zoom in, zoom out , pan and then come back to normal arrow again to allow him to interact with plot.
I can write in code viewmenufcn('FigureToolbar'); BUT it give me all toolbar with such buttons like "save" etc. When User click to that "save" button all Matlab crashed totally.
I tried to modify viewmenufcn('FigureToolbar'); in code but its over my programming skill ;)
Please help me :) Janek
0 commentaires
Réponses (4)
Azzi Abdelmalek
le 26 Avr 2013
Modifié(e) : Azzi Abdelmalek
le 26 Avr 2013
In your gui figure there is an icone called toolbar editor, click on it and add zoom in and zoom out
0 commentaires
aJackal
le 28 Fév 2017
I don't think it's possible using GUIDE. However, I found a tutorial showing you how to disable certain items from other default toolbars. So, you could enable the figure toolbar, and then hide the 'save' button.
I have added the following in MyGui_OpeningFcn: %set(hObject,'toolbar','figure');%not needed if you turn the toolbar in guide property inspector a=findall(handles.FigureToolBar,'ToolTipString','Save Figure'); set(a,'Visibility','Off')
Where you can replace 'Save Figure' with the other tool buttons you want to disable. The easiest way to find their tags is to hover the mouse over the button.
Good luck!
https://ch.mathworks.com/matlabcentral/answers/100561-how-do-i-customize-a-figure-toolbar-by-removing-certain-buttons
0 commentaires
Sjouke Rinsma
le 27 Nov 2019
So, I ended up here with the same question, and after some digging around found you can use below function to enable (or disable with 'off') figure editing:
plotedit(fig_handle, 'on');
Just draw your own white arrow toggle icon and add to the code :)
0 commentaires
Voir également
Catégories
En savoir plus sur Data Exploration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!