Show figure from Gui code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi everybody.
I have a problem with my code GUI.
a1=str2num(get(handles.x1,'String'));
b1=str2num(get(handles.y1,'String'));
c1=str2num(get(handles.z1,'String'));
a2=str2num(get(handles.x2,'String'));
b2=str2num(get(handles.y2,'String'));
c2=str2num(get(handles.z2,'String'));
a3=str2num(get(handles.x3,'String'));
b3=str2num(get(handles.y3,'String'));
c3=str2num(get(handles.z3,'String'));
f = figure();
ax = axes('Parent',f)
plot3 (ax, [a1 a2 a3],[b1 b2 b3],[c1 c2 c3], 'Marker','o','LineStyle','-');
grid(ax, 'on');
rotate3d(ax, 'on');
With this code,i can plot a graph with my GUI,but when i add a plot in my figure is not ok.
example:
a1=str2num(get(handles.x1,'String'));
b1=str2num(get(handles.y1,'String'));
c1=str2num(get(handles.z1,'String'));
a2=str2num(get(handles.x2,'String'));
b2=str2num(get(handles.y2,'String'));
c2=str2num(get(handles.z2,'String'));
a3=str2num(get(handles.x3,'String'));
b3=str2num(get(handles.y3,'String'));
c3=str2num(get(handles.z3,'String'));
f = figure();
ax = axes('Parent',f)
plot3 (ax, [a1 a2 a3],[b1 b2 b3],[c1 c2 c3], 'Marker','o','LineStyle','-');
plot3 (ax, [a1 a2 a3],[-b1 -b2 -b3],[c1 c2 c3], 'Marker','o','LineStyle','-');
grid(ax, 'on');
rotate3d(ax, 'on');
It show only line. I need two line and many line in my figure.
1 comentario
the cyclist
el 25 de Nov. de 2011
Can you please edit your post and use the "Code" markup feature? Your code is very hard to read.
Respuesta aceptada
Walter Roberson
el 25 de Nov. de 2011
After the line
plot3 (ax, [a1 a2 a3],[b1 b2 b3],[c1 c2 c3], 'Marker','o','LineStyle','-');
add
hold(ax, 'on');
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!