how can i plot in axes in other figure

조회 수: 1 (최근 30일)
ali hadjer
ali hadjer 2015년 11월 3일
댓글: ali hadjer 2015년 11월 3일
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