function showGraph()
% constants
screenSize = get(groot, 'ScreenSize');
figSize = [550, 350];
% GUI building
hFig = uifigure('Name', 'Show Graph', ...
   'Position', ...
   [(screenSize(3:4) - figSize)/2 figSize]);
hGrid = uigridlayout(hFig, ...
   'ColumnWidth', {200, '1x'}, ...
   'RowHeight', {'1x'});
hPanel = uipanel(hGrid, ...
   'BorderType', 'none', 'Scrollable', true);
hButtClose = uibutton(hPanel, ...
   'Text', 'Close', ...
   'Position', [10 10 180 30]);
hEdit = uieditfield(hPanel, 'text', ...
   'Position', [10 250 180 30], ...
   'Value', 'sin(0:0.01:2*pi)');
hEvalButt = uibutton(hPanel, ...
   'Text', 'Evaluate!', ...
   'Position', [10 290 180 30]);
hAxes = uiaxes(hGrid);
% to be continued...
% callbacks
hEvalButt.ButtonPushedFcn = ...
   @(a, b)evaluateExpression();
hButtClose.ButtonPushedFcn = ...
   @(a, b)closeFigure();
% callback functions
   function evaluateExpression()
      try
         exprOutcome = eval(hEdit.Value);
         plot(hAxes, exprOutcome, '-x');
         hEdit.BackgroundColor = 'w';
      catch
         hEdit.BackgroundColor = 'r';
         uialert(hFig, ...
            'Error in expression!', 'Error');
      end
   end
   function closeFigure()
      hFig.delete();
   end
end