필터 지우기
필터 지우기

How Assign a Plot to a Specific Axes?

조회 수: 113 (최근 30일)
Rightia Rollmann
Rightia Rollmann 2017년 2월 21일
편집: Jan 2017년 2월 21일
I have drawn two Axes in GUIDE.
How can I assign each of my plots to one of them?
when I now run it, MATLAB just put both plots on one another.

채택된 답변

Jan
Jan 2017년 2월 21일
Use the handles of the axes objects:
plot(1:10, rand(1, 10), 'Parent', handles.axes1)
plot(1:10, -rand(1, 10), 'Parent', handles.axes2)
This assumes, that your axes have the names "axes1" and "axes2" (I don't know if this is the standard in GUIDE) and that they are stored in the handles struct, which should be available in your callback.
  댓글 수: 2
Rightia Rollmann
Rightia Rollmann 2017년 2월 21일
편집: Rightia Rollmann 2017년 2월 21일
Thank you! But still one problem:
Imagine what is to be shown is stored in a struct. How can I tell MATLAB that show plot this struct in a certain Axes? Detailed Explanation here.
Jan
Jan 2017년 2월 21일
편집: Jan 2017년 2월 21일
You can assign the Parent property also using the dot notation:
R = rectangle;
R.Position = [X Y W H];
R.Parent = handles.axes2;
This is equivalent to:
R = rectangle('Position', [X Y W H], 'Parent', handles.axes2);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by