how can i plot in axes in other figure

1 visualización (últimos 30 días)
ali hadjer
ali hadjer el 3 de Nov. de 2015
Comentada: ali hadjer el 3 de Nov. de 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

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Nov. de 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 comentario
ali hadjer
ali hadjer el 3 de Nov. de 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 ???

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by