MATLAB: Conflict between background and graphics

backgroundconflictgraphicshandle graphics

Hi everybody! I'm using gui matlab to create interfaces. I set a background using axes, and now I have to add a pushbutton that show me a graphic in an other axes space, but when I push it, the graphic appears on my background, even if I correctly set my handles…
I think I need to "lock" my background axes… Or, there're any other solutions?? Can anyone help me?
This is my background code…
function sfondo3_CreateFcn(hObject, eventdata, handles)
axes(hObject)
imshow('image.png');
EDIT 1 14/01/2012 – 01.45 (European Time)
I already have my background image… This is a screenshot of my figure:
I already have my "background axes", set with a background image. When I set a pushbutton's handles that must make me appear a graph, it appears on the background, and not in "axes 2" space…
I want it appears in "Axes 2" without change my background settings…

Best Answer

Hi, Jethro
Just use the same concept.
No matter if you want to plot something in second axes instead of display an image.
Here the example :
function pushbutton1_Callback(hObject, eventdata, handles)
handles.output = hObject;
axes(handles.axes2);
x = -pi:.1:pi;
y = sin(x);
plot(x,y,'ro','linewidth',2);
axis off
guidata(hObject, handles);
%
Related Question