figure data point access in 2018a
古いコメントを表示
Sometimes I need to manually remove data points from an existing figure which are zero. It could be done fairly easily in previous releases. However I found that I can no longer do so in 2018a mac version. In particular, in figure property, the YData only shows 1xN array, and I cannot access the numerical values of those plotted points. Is this function removed from this release?
4 件のコメント
Ameer Hamza
2018 年 4 月 30 日
How are you trying to access it? I have MATLAB 2018a and this property is available.
Lian
2018 年 4 月 30 日
Ameer Hamza
2018 年 4 月 30 日
編集済み: Ameer Hamza
2018 年 4 月 30 日
@Lian, I am able to edit the property XData and YData from property editor. Can you tell me how are you plotting the figures? Alternatively, if it is not working, refer to my answer below.
Lian
2018 年 4 月 30 日
回答 (1 件)
Ameer Hamza
2018 年 4 月 30 日
編集済み: Ameer Hamza
2018 年 4 月 30 日
You can set the properties programmatically using line handles. For example
p = plot(1:10); % p is plot handle and have property XData and YData.
p.XData = 1:10;
p.YData = (1:10).^2;
It will update the line according to new data.
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!