How can i show plot inside ui app instead of another figure window?

7 views (last 30 days)
Hi, id like to show the plot inside gui app instead of another popping up figure window. Im using Andor Solis library, but i hope that is not the case of my rpoblem. I tried to include data inside PlotUI, but its not working. Here is the code:
[ret,XPixels, YPixels]=GetDetector(); % Get the CCD size
CheckWarning(ret);
[ret]=SetImage(1, 1, 1, XPixels, 1, YPixels); % Set the image size
CheckWarning(ret);
disp('Starting Acquisition');
[ret] = StartAcquisition(); %Starting Acquisition
CheckWarning(ret);
if(app.ReadoutMode==0) % 0=plot
[ret,gstatus]=AndorGetStatus;
CheckWarning(ret);
while(gstatus ~= atmcd.DRV_IDLE)
pause(1.0);
disp('Acquiring');
[ret,gstatus]=AndorGetStatus;
CheckWarning(ret);
end
[ret, imageData] = GetMostRecentImage(XPixels); %gets data ( [ret, arr] = GetMostRecentImage(size) )
CheckWarning(ret);
if ret == atmcd.DRV_SUCCESS
plot(imageData); %draws plot
end

Accepted Answer

Adam Danz
Adam Danz on 17 Aug 2019
Specify the UI Axis handle in the first input to plot().
plot(app.UIAxes, imageData);
% __________ or whatever the handle is to your ui axes
  5 Comments
Kacper Gawinkowski
Kacper Gawinkowski on 17 Aug 2019
Oh im just retaded i think, idk what happened but it just started working after i closed and opened matlab... sorry for all this mess. I guess im just tired. Thank you so much again.

Sign in to comment.

More Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!