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
Ameer Hamza 2018년 4월 30일
How are you trying to access it? I have MATLAB 2018a and this property is available.
Lian
Lian 2018년 4월 30일
What I used to do is: right click the data -> show property editor -> more properties. Now in Data section, what I can see only is 1xN double for YData (and other irrelevant entries), which does not expand to let me access the numerical values of each point. Is there an alternative way?
Ameer Hamza
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
Lian 2018년 4월 30일
I tested a very simple plot: figure, plot(sin(0:0.1:2),'ko-'); I understand that I can do that using command lines, but it is a very wired problem, as it is supposed to be very straightforward. Maybe it is due to the installation of some special toolboxes?

댓글을 달려면 로그인하십시오.

답변 (1개)

Ameer Hamza
Ameer Hamza 2018년 4월 30일
편집: Ameer Hamza 2018년 4월 30일

0 개 추천

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에 대해 자세히 알아보기

질문:

2018년 4월 30일

댓글:

2018년 4월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by