Why will quiver not overlay an imshow figure of uiaxes in appdesigner?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Cameron Starling
le 8 Fév 2022
Commenté : Cameron Starling
le 9 Fév 2022
Hi, I have a basic dicom viewer app I'm working on and want to be able to overlay a quiver arrow onto the same uiaxes as the image displayed using imshow. I have looked through similar questions which seem to imply this is quite straightforward, and can be achieved by writing them to the same axes (app.UIAxes), with a 'hold on' in between to enable overwrites. This does not work for me however, using:
imshow(image,gray,'parent',app.UIAxes);
hold on
quiver(app.UIAxes,256,256,-1,-1) % just some dummy numbers
I appreciate I haven't set axis limits, but I would still expect to have only 1 figure, even if I couldn't see the arrow. How can I force the arrow and image to share the same axes?/What am I failing to understand?
Cheers, C
2 commentaires
Réponse acceptée
Walter Roberson
le 9 Fév 2022
hold on
You have not told hold which axes to work against. It is going to search for the active axes to change the properties of. It is only going to search traditional axes in traditional figures, and will never look at the uifigure uiaxes to determine if it is active. Then, not seeing an active traditional figure, it is going to create one...
You need
hold(app.UIAxes, 'on')
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Vector Fields dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!