title: How to get coordinates of the clicked point when data cursor mode is on in matlab?
body: <p>I'm trying to design and program a GUI in Matlab, with which I'm not familiar.</p>
  
  <p>Basically, I have two components, which are "axes" and "list box". There is an RGB image in the axes. I'm planning to add the selected point to the list box.</p>
  
  <p>The following code works just fine, but I would like to make it work when the data cursor is on.</p>
  
  <p>How can I make it work when the data cursor is on?</p>
  
  <pre><code>% 100x100x3 RGB image
  RgbImage = randi(100, 100, 100, 3);
  
  % Draw the image
  axesHandle = axes();
  imageHande = imagesc(RgbImage);
  axis image;
  
  % ButtonDownFc
  set(imageHandle, 'ButtonDownFcn', @imageButtonDownFcn);
  function imageButtonDownFcn(hObject, eventdata)
      p = get(gca, 'CurrentPoint');
      x = floor( p(1) );
      y = floor( p(2) );
  
      % Some code to add the [x y] to the list box
  end
  </code></pre>
  
  <p>Edit 1:
  The problem is that the function <strong>imageButtonDownFcn</strong> is not triggered when data cursor is on.</p>