two plots in same GUI

a = [2 3 7];
plot3(a(1),a(2),a(3),'r.')
a = [6 3 4];
plot3(a(1),a(2),a(3),'r.')
I have to plot this both 3D plots in different figures in same GUI.
so, below each plot3 commant what line i have to write to do this..
I understand that something like
set(handles.axes1)
and
set(handles.axes2)
may be, but give me an exact command.

 採用された回答

Walter Roberson
Walter Roberson 2012 年 12 月 25 日

0 投票

4 件のコメント

Lalit Patil
Lalit Patil 2012 年 12 月 25 日
I see it.. I want in different figures means it should not generate new window.. Both figures should be on same GUI axes..
Walter Roberson
Walter Roberson 2012 年 12 月 25 日
In MATLAB, "figure" and "window" are the same thing: "figure" is MATLAB's term for windows.
You can have multiple axes in the same window, though, and you can have multiple lines on any axes.
If you want two plots on the same axes, then you can use
a = [2 3 7];
plot3(a(1),a(2),a(3),'r.')
hold on
a = [6 3 4];
plot3(a(1),a(2),a(3),'r.')
or better,
a = [2 3 7];
b = [6 3 4];
plot3( a(1), a(2), a(3), 'r.', b(1), b(2), b(3), 'r.')
Lalit Patil
Lalit Patil 2012 年 12 月 25 日
Yes, what you given works correctly for two plots on same axes.. But, i mean to ask is on same GUI means on two different axes.. Which i think requires use of handle..
Walter Roberson
Walter Roberson 2012 年 12 月 25 日
Then just follow the instructions from the link I gave, to parent the plot3() against the appropriate axes.
a = [2 3 7];
plot3(FirstAxesHandle, a(1), a(2), a(3), 'r.')
or
plot3(a(1), a(2), a(3), 'r.', 'Parent', FirstAxesHandle)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by