I am creating a real time MATLAB demo and I need to select a point of interest by clicking on the axes
. In general, the system works fine and I am able to modify the variables using the ButtonDownFcn
. However the following problem occurs
When I plot other data (such as a scatter plot) on the same axis, the ButtonDownFcn
does not seem to be triggered if I click on the scatter plot rather than the axes
where there is no plot. There are no errors.
This is an issue because my scatter plots can be quite dense and the point I would like to click on lies underneath of the plot object.
How can I make it so that all mouse clicks are registered by the axes
so that my ButtonDownFcn
gets executed on every click.