Show figure from Gui code
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
the cyclist
2011 年 11 月 25 日
Can you please edit your post and use the "Code" markup feature? Your code is very hard to read.
採用された回答
Walter Roberson
2011 年 11 月 25 日
After the line
plot3 (ax, [a1 a2 a3],[b1 b2 b3],[c1 c2 c3], 'Marker','o','LineStyle','-');
add
hold(ax, 'on');
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!