Why do plotting commands delete axes UserData?
6 ビュー (過去 30 日間)
古いコメントを表示
If I store data in the UserData property of an open axes object and then plot something on the axes, the UserData is deleted. Does this happen for a good reason, and is there any way to prevent it?
Here is sample code to illustrate this:
>> myAx = axes;
>> myAx.UserData = 1:10;
>> myAx.UserData
ans =
1 2 3 4 5 6 7 8 9 10
>> plot(rand(5))
>> myAx.UserData
ans =
[]
I'd like to have UserData persist after adding more graphics objects to the axes.
0 件のコメント
採用された回答
Bruce Elliott
2020 年 4 月 16 日
1 件のコメント
Steven Lord
2020 年 4 月 16 日
Not all properties are reset. Units and Position keep their values.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!