Why will quiver not overlay an imshow figure of uiaxes in appdesigner?
4 views (last 30 days)
Show older comments
Cameron Starling
on 8 Feb 2022
Commented: Cameron Starling
on 9 Feb 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 Comments
Accepted Answer
Walter Roberson
on 9 Feb 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')
More Answers (0)
See Also
Categories
Find more on Vector Fields in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!