CurrentPoint and ButtonDownFcn give different results
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have a figure with axes x=8-10 microns, y=30-40 microns. When I click on the figure, in the image region (not the background), and then execute
ax=gca;
ax.CurrentPoint(1,1)
ax.CurrentPoint(1,2)
in the command window, I get two values which are sensible (the first lies between 8 and 10, and the second between 30 and 40). Within my code, I also have the lines
set(myax,'ButtonDownFcn',@CallBackFcn,'HitTest','on')
set(myfig,'ButtonDownFcn',@CallBackFcn,'HitTest','off')
When I run my code and click on (roughly) the same point as before, nothing happens. But, when I click on the background, to the right of the actual image, I get very large values (over 100 for x and a y>40). Can someone explain if my 'HitTest' 's are set incorrectly, and if so, what the proper way is? The callback function used for the axes and the figure is the same. (Note that the labelling of my y axis runs opposite to the traditional way; values at the bottom are greater than those at the top; this is intentional due to the details of my project).
Thanks for your help!
2 comentarios
Walter Roberson
el 12 de Jul. de 2018
You appear to be using R2014b or later. You should have a look at the newer PickableParts properties.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!