Issue implementing WindowButtonDownFnc to a single plot/image

조회 수: 1 (최근 30일)
Ahmet Alper Özkan
Ahmet Alper Özkan 2020년 4월 1일
댓글: Ahmet Alper Özkan 2020년 4월 2일
I'm currently using the App Designer; my aim is to get pixel data (from a left mouse button click) from an image designated in a single UIAxes object (ImageAxes), and display the data in another UIAxes object (PixelAxes). To give a bit more context, each pixel of the image corresponds to a specific RAMAN spectra.
My issue is that even though I specify the 'CurrentPoint' coordinates to be taken from JUST ImageAxes; whenever I click on another plot, the displayed spectra changes. In other words, the CurrentPoint property applies to ALL of the axes rather than a single one. What I've done so far is given down below. I tried to implement a line from the answer here.
function ImageAxesWindowButtonDown(app, event)
if ~isempty(event.Source.CurrentObject) && isequal(event.Source.CurrentObject.Tag, 'imageAxTag')
temp = app.ImageAxes.CurrentPoint;
xy = [temp(1,1) temp(1, 2)]; xySum = round(sum(xy));
plot(app.PixelAxes, app.shift_lambda, app.finalDataNormalized(:, xySum))
end
end
Could it be because I did not designate the tag properly?
  댓글 수: 2
Mohammad Sami
Mohammad Sami 2020년 4월 2일
you can perhaps try isequal(event.Source.CurrentObject,app.ImageAxes)
Ahmet Alper Özkan
Ahmet Alper Özkan 2020년 4월 2일
Tried this, unfortunately did not work.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Display and Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by