필터 지우기
필터 지우기

How can I put a line into an existing subplot

조회 수: 21 (최근 30일)
Sebastian Gatzka
Sebastian Gatzka 2012년 3월 15일
Hello World,
I want to add a line into an existing subplot. I have identified the axes which form the subplot and set them to hold:
>> allAxes = get(gcf,'Children'); >> axis(allAxes(6)); >> hold on
(I can even toggle the visibility just to make sure these are the right axes)
If I call the code to produce the line:
>> line([a a], [b b]);
this line is allways created in a different subplot than the one I have choosen. I thought calling axis(allAxes(6)) makes the current subplot the active one?
Whats wrong? Any ideas? Sebastian

채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 15일
line([a a], [b b], 'Parent', AllAxes(6))

추가 답변 (1개)

Honglei Chen
Honglei Chen 2012년 3월 15일
Do you have to use line? You can try
plot(allAxes(6),[a a],[b b]);

카테고리

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