Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Plot only every n'th dot, change from figure menu without extracting the data

조회 수: 1 (최근 30일)
Erez
Erez 2018년 6월 8일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a figure with many curves on it. I wish to change the frequency of the dots only for some of the curves. Is there a way to do this directly (and simply) from the figure menum or the properties of the curve? Namely without having to extract the data into arrays (I only have the figure, not the original *.mat file)?

답변 (2개)

Ameer Hamza
Ameer Hamza 2018년 6월 8일
편집: Ameer Hamza 2018년 6월 8일
Yes, you can do that uses axes and line handles. For example, open the figure and run
ax = gca
it will give you the axes handle. If you then try
ax.Children
you will see an array of lines like this
ans =
2×1 Line array:
Line
Line
You can then change the XData and YData of each line individually. For example, to delete even index elements from the first line, try
ax.Children(1).XData(2:2:end) = [];
ax.Children(1).YData(2:2:end) = [];

Steven Lord
Steven Lord 2018년 6월 8일
If you're using release R2016b or later, use the findobj or findall functions to find the handle of the object created by plot then set the MarkerIndices property of that handle or those handles.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by