You had it right but then commented it out:
function slider1_Callback(hObject, eventdata, handles)
%global theta
%theta = get(handles.slider1,'Value')
so all you have to do now is to use theta in whatever way to do to plot the stuff you want to plot. But it looks like you put that code in the output_fcn for some reason. This will run on startup and on shutdown. But what you should do is to put all that stuff in a standalone function called "PlotMyData" or whatever. That function should take handles as an input, and be called from your slider callback, and from either the opening_fcn() or the output_fcn() function, but not both. Output_fcn gets run after opening_fcn() gets run. Sometimes it's necessary to put things in the output function if what you're doing depends on the GUI being displayed. Sometimes you can set properties for controls in the Opening function but if that's not working, then put it in the output function and it should work then.
