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

3 次查看(过去 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 Object Properties 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by