mark points on graph
이전 댓글 표시
~do calculations
x=ddata;
y = edata;
handles=guidata(hObject);
[X,Y] = peaks;
surf(X,Y);
xlim([-inf inf]);
ylim([0 inf]);
plot(x,y,'parent',handles.axes1);
hold on
plot(x_mark,y_mark,'c*',handles.axes1)
hold off
the x_mark and y_mark are both in array that I got from a while loop. I made a GUI that plots the figure
댓글 수: 2
Jan
2018년 1월 22일
Please read http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup. What is your question?
hi hey
2018년 1월 22일
답변 (1개)
Jan
2018년 1월 22일
Example:
x = 1:10;
y = rand(1, 10);
s = [2,4,8]; % Indices of points to mark
plot(x, y);
hold on
plot(x(s), y(s), '*')
댓글 수: 4
hi hey
2018년 1월 22일
Jan
2018년 1월 22일
I cannot guess what does not work or why which points are below which line. Please post the details.
hi hey
2018년 1월 22일
Jan
2018년 1월 22일
@hi hey: This explanation does not help to understand "That didn't work" and why which points are shifted vertically. If you still need help, please post something, which let the readers reconsider, what's going wrong: code, input data, screenshot of the diagram, ...
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!