Show figure from Gui code
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
the cyclist
am 25 Nov. 2011
Can you please edit your post and use the "Code" markup feature? Your code is very hard to read.
Akzeptierte Antwort
Walter Roberson
am 25 Nov. 2011
After the line
plot3 (ax, [a1 a2 a3],[b1 b2 b3],[c1 c2 c3], 'Marker','o','LineStyle','-');
add
hold(ax, 'on');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Identification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!