How can I hide the "Az: El:" readout while rotating an axes object?

6 views (last 30 days)
Josh G.
Josh G. on 14 Feb 2019
Edited: Josh G. on 29 Oct 2020
I'm designing a programmatic GUI with a popup window to illustrate how azimuth and elevation are defined. This illustration is in the form of axes that can be rotated by the user with some text underneath describing various terms.
Azimuth (in my use case) is defined as the angle measured clockwise from the positive y axis, but MATLAB's camera defines azimuth as the angle measured counterclockwise from the negative y axis. As a result, there is no way for me to change the plot (e.g. plotting the "positive y axis" on the negative y axis and hiding labels) such that both azimuth and elevation are measured the same for the camera and my use case.
The problem is, when the user rotates the axes object, a readout of camera azimuth and elevation is displayed in the lower left corner of the figure. I'd like to keep users from being confused by an az/el readout that doesn't match what is displayed in the plot. I've tried putting a uipanel over that part of the figure, but the az/el readout just appears over it as soon as I rotate the plot.
Can I hide this readout by turning off a property or covering it up with something else?

Accepted Answer

Josh G.
Josh G. on 14 Feb 2019
Edited: Josh G. on 14 Feb 2019
I've solved this, so I'll describe the solution in case anyone else wants to do this.
In my GUI, I had to enable rotation manually by using rotate3d. On a mouse drag, this function writes the camera azimuth and elevation to the current uimode's ModeStateData.textBoxText property, which is then displayed at the bottom left of the current figure. ModeStateData is a struct with a field textState set equal to 1. Setting this field equal to 0 turns off the az/el readout.
To do this in a gui, you'll have to get access to the uimode object handled by rotate3d. From a blog post on undocumentedmatlab.com, I found that this was possible using the uigetmodemanager function. The fix is a simple two lines:
hManager = uigetmodemanager(yourFigure);
hManager.CurrentMode.ModeStateData.textState = 0;
  3 Comments
Josh G.
Josh G. on 29 Oct 2020
Peter,
Just over a year later this question showed up as the top search result for a problem I was still having with hiding the Az/El text. As the GUI I'm developing has become heavier and heavier, setting textState to 0 has become unreliable; doing it too quickly results in the value being set but without any effect. I tried several hacks with adding pauses up to as long as 4 seconds to "let all of the data get where it needed to be," all of which worked at first and then stopped working over time.
Your solution is far more elegant and I've switched to it with great results. I'm not sure what v.h.figure refers to in your callback, but for me it works using v alone since that corresponds to my figure handle for the whole GUI.

Sign in to comment.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by