Why will quiver not overlay an imshow figure of uiaxes in appdesigner?

2 次查看(过去 30 天)
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 个评论
Cameron Starling
Cameron Starling 2022-2-9
1) If I use the imshow line first followed by hold on then quiver, the arrow shows in the uiaxes on the app window, and a blank axes pops out in a new figure (I cant see my image). 2) If I remove the hold on line the blank pop out no longer shows, only the arrow in the app window.
3) If I use the quiver line first followed by hold on and imshow, I can see my image in the app window and another blank axes pops out, and i can't see the arrow. 4) When I remove hold on with quiver first, I only see my image, as expected. The first 3 of 4 behaviours don't make sense to me.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-2-9
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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by