I am trying to make two plots in the same GUI figure that has 2 different axes. I would like one plot in one axes whereas the next one in the other. However, both my plots are generated from a single function, which I call in the GUI with a push button.
When I write axes()
before the 2nd plot inside the function, I get a third axes which is misplaced. If I omit the axes()
call, I get both plots in the same axes. How can I plot the second graph in the second axes?
GUI
function pushbutton1_Callback(hObject, eventdata, handles)
---------
---------
---------
axes(handles.axes1);
kendrickplot(n,alpha,em,infile,outfile);
---------
Function
function [ynew,xnew]=kendrickplot(n,alpha,em,infile,outfile)
---------
---------
scatter(xnew,ynew,'b.')
xlim([0,max(a(:,4))])
ylim([min(a(:,5)),max(a(:,5))])
hold on
plot(xnew,n*(ones(length(xnew))),'r')
scatter(a(:,4),a(:,5))
end