필터 지우기
필터 지우기

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 CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by