MATLAB: Matlab App Designer Plot

graphplotting

I can run the GUI i created but i am having difficulties when i press the calculate button. Everything works fine and the graph appears however an extra empty figure window is also appearing. I am new to matlab so i am unsure how to resolve the problem. Also I would like the x grid to be visible upon running the GUI (the inital graph should have the x grid on so it resembles strips of wood in my case) but i cannot figure out how to do this. Once i run my GUI and press calculate the grid lines show up but they dont upon initally opening running the GUI
any help is appreciated! thank you

Best Answer

Without seeing your code, we can only guess. The most likely reason is you did not tell the plot command which axes to plot to. Include the target axes in the plot command:
plot(app.UIAxes,X,Y)
For the grid lines - in the design view in appDesigner, select your axes and then in the Axes Properties (on the right), expand GRIDS and place a check box in XGrid.
xGrid.png