フィルターのクリア

linkprop does not work with multidimensional array of objects

86 ビュー (過去 30 日間)
T A
T A 2024 年 6 月 24 日 22:32
回答済み: T A 2024 年 6 月 30 日 17:28
Bug report: If given an array (not a vector) of objects, then linkprop doesn't link properties for all the objects it is given, but rather a subset of them:
fig=figure;
nrow=3;
ncol=2;
tl=tiledlayout(nrow,ncol);%,'tileindexing','columnmajor');
ax=gobjects(nrow,ncol);
for cnt1=1:nrow*ncol
ax(cnt1)=nexttile;
plot(1:2,3:4)
end
ln=linkprop(ax,{'xlim','ylim'});
ax(1).XLim=[1.5,2.5];
disp('ln.Targets(:).XLim')
ln.Targets(:).XLim
ln.Targets(:).XLim
ans = 1x2
1.5000 2.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1.5000 2.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1.5000 2.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
disp('ax(:).XLim')
ax(:).XLim
ax(:).XLim
ans = 1x2
1.5000 2.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1.5000 2.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1.5000 2.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ans = 1x2
1 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Which objects do get linked depends on whether 'rowmajor' or 'colummajor' tile indexing are used. It sort-of operates on just the first row/column of objects given in the array, for instance try changing nrow and ncol to be equal to each other. I have the problem in 2023a, seems it's also present in the latest release (2024a) based on the results above.

採用された回答

T A
T A 2024 年 6 月 30 日 17:28
I submitted a bug report. Mathworks has verified this is a bug. Unclear if it'll get addressed, so I asked that they at least update the documentation to state the axes object array must be a vector.

その他の回答 (1 件)

Avni Agrawal
Avni Agrawal 2024 年 6 月 27 日 6:23
編集済み: Avni Agrawal 2024 年 6 月 27 日 6:23
Hi @T A,
I seems like there is some sort of a timing issue. Even i'm facing the similar issue. The messages to link the axes are arriving at the client before the messages to register the axes control for each axes, so it's not able to link whichever axes is created last, as its control is not yet created when the message to link it is received.
I would suggest to contact someone from the Mathworks Technical Support: https://www.mathworks.com/support/contact_us.html
I hope this helps.

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by