Borrar filtros
Borrar filtros

Create a subplot that can toggle linkaxes.

1 visualización (últimos 30 días)
Scott
Scott el 9 de Abr. de 2013
I have a GUI that creates subplots of user selected data. I want the user to have the ability to toggle between having the x-axis of each subplot linked using linkaxes. Is there a way to embed this functionality in the created subplot figure?
Right now, the axes are either linked or they are not; I don't know how to toggle between the two without returning to and using a pushbutton on the main GUI.
Thank you in advance, Scott
  2 comentarios
Jan
Jan el 9 de Abr. de 2013
What is the actual question? You do not want to create a push-button? Why not? Would a corresponding menu in the figure's or subplot's context menu solve the problem? Or what about an entry in the menu bar?
Scott
Scott el 9 de Abr. de 2013
Those are all good suggestions. I would prefer to have a pushbutton on the created subplot figure. I just don't know how to do that. I only know how to add pushbuttons using guide. If there's a way to do it programmatically, so I could create a figure, add subplots, and add a pushbutton, I think that would solve my problem.

Iniciar sesión para comentar.

Respuestas (1)

Jan
Jan el 9 de Abr. de 2013
Editada: Jan el 9 de Abr. de 2013
Open a figure and create a button:
FigH = figure;
ButtonH = uicontrol(FigH, 'Style', 'pushbutton', ...
'Units', 'pixels', ...
'Position', [10, 10, 120, 22], ...
'String', 'Link axes', ...
'Callback', @yourCallbackFcn);
  1 comentario
Scott
Scott el 9 de Abr. de 2013
Thank you! However, when I use this solution, I lose other plotting tools. Is there a way to keep them (pan, zoom, data cursor, etc) on the figure as well?

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by