GUI and line(input,input): Coordinates plot, line does not plot

1 view (last 30 days)
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','-')

Answers (0)

Categories

Find more on Polar Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!