フィルターのクリア

Create a subplot that can toggle linkaxes.

1 回表示 (過去 30 日間)
Scott
Scott 2013 年 4 月 9 日
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 件のコメント
Jan
Jan 2013 年 4 月 9 日
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 2013 年 4 月 9 日
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.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2013 年 4 月 9 日
編集済み: Jan 2013 年 4 月 9 日
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 件のコメント
Scott
Scott 2013 年 4 月 9 日
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?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by