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

3 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 8 月 18 日
回答済み: Urmila Rajpurohith 2019 年 8 月 21 日
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 Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by