Error using subplot, cannot set property to a deleted object

조회 수: 12 (최근 30일)
Aidan Shek
Aidan Shek 2020년 2월 14일
답변: Walter Roberson 2020년 2월 14일
Hi
I am wanting to plot two figures side by side.
I am wanting to plot the output of sliceViewer from a 3d object that I have and this is what I have attempted
figure(2);
subplot(1,2,1)
sliceViewer(G1,'Colormap',cmap);
subplot(1,2,2)
sliceViewer(G2,'Colormap',cmap);
Which gives me this error
Error using axes
Cannot set property to a deleted object
Error in subplot (line 602)
ax = axes('Units', 'normalized', 'Position', position, ...
Error in Deconvolve3d2 (line 94)
subplot(1,2,2)
I think it is something to do with how sliceViewer displays its outputs and it is somhow deleting the axes for the subplot
Thanks
  댓글 수: 3
Aidan Shek
Aidan Shek 2020년 2월 14일
Yes I am trying to create a plot with the two outputs of sliceViewers being shown next to each other.
When I try to run this I am unable to see either sliceViewer output and I get an error.
Walter Roberson
Walter Roberson 2020년 2월 14일
It does give the impression that sliceViewer is deleting the figure, or that the "current figure" is being left at something that is deleted.

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 14일
sliceViewer deletes the axes of its parents, so you cannot put it into a subplot.
However, sliceViewer can be put into a uipanel. Therefore you can create a uipanel beside your other graphics axes, and specify the uipanel by passing the 'Parent' option to sliceViewer()

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by