how can i plot in axes in other figure

1 Ansicht (letzte 30 Tage)
ali hadjer
ali hadjer am 3 Nov. 2015
Kommentiert: ali hadjer am 3 Nov. 2015
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 3 Nov. 2015
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 Kommentar
ali hadjer
ali hadjer am 3 Nov. 2015
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 ???

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by