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

7 vues (au cours des 30 derniers jours)
Patrick Perales
Patrick Perales le 26 Mar 2019
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','-')

Réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by