GUI and line(input,input): Coordinates plot, line does not plot
조회 수: 7 (최근 30일)
이전 댓글 표시
The following code plots coordinate pairs inputted by the user. The points plot, however, the lines that are suppose to plot due to the line function are not plotting. Could this be due to the handles of the input of the line function (handles.X_coord, handles.Y_coord) or should there be handles on the line plot as well? Any reference is appreciated. Thank you.
function Coord_button_Callback(hObject, eventdata, handles)
hold off
x_coord = handles.X_coord;
y_coord = handles.Y_coord;
axis([0, max(x_coord)+1, 0, max(y_coord)+1])
member = line(x_coord,y_coord,'Marker','.','LineStyle','-');
set(member,'Color','red')
guidata(hobject, handles);
hold on
The following code is an example of what I mean by the lines to be plotted,
x = [ 0 1 0 1 1 1 1 2 1 2 1 2 2 2 3 2 3];
y = [ 0 0 0 1 0 1 1 1 1 0 0 0 1 0 1 0 0];
axis([0 3 0 3])
line(x,y,'Marker','o','LinStyle','-')
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!