How to draw a stored shape that is not currently drawn on an axis?

조회 수: 1 (최근 30일)
Joseph Henry
Joseph Henry 2019년 7월 24일
댓글: Joseph Henry 2019년 7월 25일
Let's say that I have a vector holding a bunch of shapes:
x =
1×3 graphics array:
Ellipse Rectangle Circle
These shapes have just been loaded to the workspace from a .mat file. Because of this, they are not drawn on any axis.
How can I draw these images with code on a parent axis?

채택된 답변

Geoff Hayes
Geoff Hayes 2019년 7월 25일
Joseph - you could perhaps try changing the parent property of the stored graphics object to be that of the new parent axis. For example, we can create a recrtangle object on one figure
>> figure
>> axis([0 10 0 10])
>> hRect = rectangle('Position',[1 2 5 6]);
and then "transfer" this rectangle to another figure
>> figure
>> axis([0 10 0 10])
>> set(hRect, 'Parent', gca);
Perhaps this will work for you too.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by