I assume you're using GUIDE. So you've placed an axes control onto your GUI (figure). Let me assume that control has a "tag" property of axes1. So handles.axes1 is the handle to the axes control. When you want to plot, assign title, x and y labels, etc. just call the axes() function passing it the handle to the axes you want the functions to apply to, so in your push button callback, have this:
axes(handles.axes1);
plot(1:10, 'b*-', 'LineWidth', 2, 'MarkerSize', 13);
xlabel('X', 'FontSize', 20);
ylabel('Y', 'FontSize', 20);
title('Y vs. X', 'FontSize', 20);
One problem in passing the axes into plot() is that it doesn't make it the current axes, so functions like title() will apply to whatever axes is "current", which may have been some other one, not the one you called plot for while passing in the handle. If you do it like I did, then xlabel, etc. will definitely apply to this axes and no other one.
Best Answer