GUI and line(input,input): Coordinates plot, line does not plot
1 次查看(过去 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 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!