MATLAB: Axes doesn’t work in matlab 6

axes matlab6

Hi guys
I would appreciate a bit of help.
I have a very simple piece of code, made almost entirely with guide in Matlab 6. I cannot get the graph inside the gui to draw anything. Instead a new figure window is opened.
it is driving me crazy….
this is the code:
function varargout = ff(varargin)
% FF Application M-file for ff.fig
% FIG = FF launch ff GUI.
% FF('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 20-May-2014 00:05:48
if nargin == 0 % LAUNCH GUI
fig = openfig(mfilename,'reuse');
% Use system color scheme for figure:
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
% Generate a structure of handles to pass to callbacks, and store it.
handles = guihandles(fig);
guidata(fig, handles);
if nargout > 0
varargout{1} = fig;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
catch
disp(lasterr);
end
end
% --------------------------------------------------------------------
function varargout = pushbutton1_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.pushbutton1.
axes(handles.axes1)
x=0:2*pi/1000:2*pi;
x=sin(100*x);
plot(x);
%if I do the following command the property changes to on so something is working.
%set(handles.axes1,'XGrid','on')

Best Answer

Set the figure's 'HandleVisibility' to be 'on'.
set(fig,'HandleVisibility','on')
Related Question