Hello Everyone,
Recently I have been attempting to make a graphic user interface (GUI) for some of the scripts previously written by one of the grad students in our lab to make it easier for students who don't have experience with editing code to use. One of the scripts is for correcting the baseline of our Raman data, for this he used the built-in msbackadj function. Now this works fine as is but to keep everything neat and tidy I've been trying to keep everything within the main app window, I have two graphs in the app to handle any of our plots, and I'm not sure how to put the plot of msbackadj into one of these windows instead of spawning its own figure window.
I've included my code for the Baseline correction button but the only really important part there is the
ICorr = msbackadj(app.Pixel2,app.I2,'WindowSize',app.window,'StepSize',app.step,'Showplot',true);
line. Setting Showplot to true pulls up a separate figure window showing the plot of Pixel2 and I2 alongside what is being subtracted from that plot. I'd like to put all of this into the UIAxes that I have on the main app window.
Any assistance or advice anyone has would be greatly appreciated. Thanks in advance.
% Button pushed function: BaselineCorrectionTestButton
function BaselineCorrectionTestButtonPushed(app, event) %Adjust the "Window Size" and "StepSize" until you achieve a baseline
%correction which looks good. Use these values in "BaselineCorrAll"
%Note: Baseline correction must be done BEFORE calibration
ICorr = msbackadj(app.Pixel2,app.I2,'WindowSize',app.window,'StepSize',app.step,'Showplot',true); %Plot the baseline corrected data next to the original.
% figure;
plot(app.UIAxes2, app.Pixel2, app.I2); hold (app.UIAxes2, 'on') plot (app.UIAxes2, app.Pixel2, ICorr); hold (app.UIAxes2, 'off') end
Best Answer