title: Plot from external function to axes matlab GUI
body: <p>I have been trying to get a plot from an external function to an axes inside a GUI. I am <strong>not</strong> using GUIDE. I have tried multiple ways but I keep getting the error</p>
  
  <pre><code>Not enough input arguments.
  
  Error in dummyGUI/plotButton_callback (line 19)
      set(hfigure,'CurrentAxes',handles.axes1)
  </code></pre>
  
  <p>Now I have made a dummy GUI and the plot is made in the command window, but I cant get rid off the error.</p>
  
  <p>My code is very simple and as follows:
  function dummyGUI</p>
  
  <pre><code>f = figure('Name','Name1','Tag','Name1','Units','Pixels','Position',[50 50 1000 600]);
  
     plotButton = uicontrol('Style', 'pushbutton',...
                           'Parent', f,...
                           'String', 'plot',...
                           'Units', 'pixels', 'Position', [100 400 100 20],...
                           'Callback',@plotButton_callback);
  
      axes1 = axes('Parent', f,... 
                      'Units', 'pixels', 'Position', [50 50 500 300]);
  
  
  
      function plotButton_callback(hObject, eventdata, handles)
          hfigure = getappdata(0,'hfigure');
          axes1 = getappdata(0,'axes1')
  
          set(hfigure,'CurrentAxes',handles.axes1)
  
      end
  end
  </code></pre>
  
  <p>the code I used in the command window is:</p>
  
  <pre><code>x = 1:100;
  plot(x,x.^2);
  hfigure = gcf;
  hfigure = setappdata('0','hfigure')
  </code></pre>
  
  <p>There is something missing obviously, but I have no idea what.</p>
  
  <p>Many thanks in advance.</p>
  
  <p>Romano</p>