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

4 vues (au cours des 30 derniers jours)
Kacper Gawinkowski
Kacper Gawinkowski le 17 Août 2019
Commenté : Adam Danz le 18 Août 2019
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

Réponse acceptée

Adam Danz
Adam Danz le 17 Août 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 commentaires
Kacper Gawinkowski
Kacper Gawinkowski le 17 Août 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.
Adam Danz
Adam Danz le 18 Août 2019
I've been there! ;)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Animation dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by