How do I prevent the pointer change when I bring the mouse cursor to a graph in a figure? (Regarding the mouse pointer update in r2020a)

7 views (last 30 days)
I've been using r2019 version matlab, and I updated recently. I noticed the change in the mouse pointer to a cross shape which I find it rather hindering in terms of the user experience because in the previous version I could easily identify which data point my mouse cersor was on with a dot on graphs, whereas with the new cross shape it is harder.
Is there a way I can change restore the default setting just like the previous matlab versions?
I appreciate your help in advance.
EDIT: I tried followng:
f = figure;
f.Pointer = 'arrow'
This technically solves the problem. However, this isn't quite the solution I'm looking for since this only applies to the figure I predefine, not as a default setting. If I close this figure and rerunt the plot function, it goes back to the way it is. I'd like to change the default setting.

Answers (1)

Adam Danz
Adam Danz on 2 Mar 2021
Edited: Adam Danz on 6 Mar 2021
To prevent the datatip cursor from appearing when hovering over a graphics object,
fig = figure();
fig.PointerMode = 'manual'; % undocumented
- tested in r2020b.
My previous answer was moved to the comments section below.
  1 Comment
Adam Danz
Adam Danz on 6 Mar 2021
My old answer:
Axis cursors show available interactions starting in r2020a (2020a release notes > Graphics).
As you've discovered, setting the figure pointer disables the cursor changes. If datatips are enabled by clicking the datatip toolbar icon, the custom crosshairs will appear again. Alternatively, you could disable default interactivity to avoid the cursor changes while the toolbar buttons still allow the user to turn on/off the tools.
If you'd like to make these changes to all future figures by default, it gets more complicated. Here are two ideas, neither of which I'm completely comfortable with.
1. Create your own figure function that creates a figure with your default settings such as,
function h = makeFig()
h = figure();
h.Pointer = 'arrow';
end
2. Define a default CreateFcn for all figures that set the figure's pointer of define a default CreateFcn for all axes that disables the axes' default interactivity. Here are 3 answers that show ways to do this and some of the approachs are problematic so read all comments before moving forward with this idea.
I searched for a way to change the pointer for datatip interactivity but there is no default setting for that (or, I couldn't find it).

Sign in to comment.

Categories

Find more on Interactive Control and Callbacks 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!