inset of matlab figure inside the figure doesnot show new axes label

조회 수: 10 (최근 30일)
Here is the code I used:
figure (3)
plot(total_cellcount.time,(prolif.')./total_cellcount.sum_sum_cell_count,'o')
xlabel('Time');
ylabel('No. prolif. cells/total No. cells')
axes('Position',[.7 .7 .2 .2])
box on
plot(total_cellcount.time,prolif,'o')
xlabel('Time');
ylabel('No. prolif. cells')
The axes label of inset figure is the same as the main figure. How can I fix it?
  댓글 수: 1
dpb
dpb 2019년 8월 18일
편집: dpb 2019년 8월 19일
Looks OK here...need enough to duplicate the issue. Have a feeling the figure you generated didn't come from the code above in its entirety...particularly since there's nothing to have generated the data it has to be only a piece.
In general when using multiple axes, save the axes handle to each figure and ensure are plotting into the desired axis. Probably (altho we can't see it here) your actual problem figure has had something else happen that changed focus so that you wrote to the other axes handle than you expected.
Execute close 3 and then only the above code and see if symptoms don't change. But still, save the handles of the two axes when you create them and then use that axis as the target for the various plotting instructions instead of default.

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

채택된 답변

Urmila Rajpurohith
Urmila Rajpurohith 2019년 8월 21일
When using multiple axes in a figure return the Axes objects as hAx1,hAx2
hFig=figure (3)
hAx1=axes(Parent,hFig)
plot(hAx1,total_cellcount.time,(prolif.')./total_cellcount.sum_sum_cell_count,'o')
xlabel(hAx1,'Time');
ylabel(hAx1,'No. prolif. cells/total No. cells')
hAx2=axes('Position',[.7 .7 .2 .2])
box on
plot(hAx2,total_cellcount.time,prolif,'o')
xlabel(hAx2,'Time');
ylabel(hAx2,'No. prolif. cells')
You can refer to the following documentation link for more information regarding "Axes properties".

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by