how can i plot in axes in other figure

1 次查看(过去 30 天)
i have a figure 1 and i wish plot in axes 2 in figure2 within a callback push bouton of the first figure????????? i will be presaure

采纳的回答

Walter Roberson
Walter Roberson 2015-11-3
If ax2 is a handle to the appropriate axes in figure 2, then
plot(ax2, .... whatever you want to plot)
For example
fig2 = figure(2);
ax2 = findobj(fig2, 'tag', 'axes2'); %retrieve the handle from the figure
plot(ax2, t, pressure);
  1 个评论
ali hadjer
ali hadjer 2015-11-3
my code in figure 2 axes2=handles.axes2 and my code in figure one in call back buton: function pushbutton4_Callback(hObject, eventdata, handles)
optimisationfigure;
handles.axes2=gca;
if isfield(handles,'net')
for i = 1:numel(handles.net(1,:))
for j = 1:numel(handles.net(1,:))
X1 = handles.net(2,i);
Y1 = handles.net(3,i);
X2 = handles.net(2,j);
Y2 = handles.net(3,j);
xSide = abs(X2-X1);
ySide = abs(Y2-Y1);
d = sqrt(xSide^2+ySide^2);% distance euclidienne
DD(:,i)=d;
disp(DD);
if (d<=handles.r)&&(i~=j)
plot([X1,Y1],[X2,Y2],'o','LineWidth',0.1);
hold on;
end
end
end
end
and itsn t worker ???

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by