필터 지우기
필터 지우기

Access the data of the axis behind another axis.

조회 수: 1 (최근 30일)
amin rasoulof
amin rasoulof 2016년 8월 25일
답변: Walter Roberson 2016년 8월 25일
I have two axes with exact same position; one overlaying the other. Now when I need to access the data of the underneath axis with data cursor, it snaps to the data of the top axis. I tried the "linkaxes" but it did not work. What can I do to get hold of the data of bottom axis? Here is what I have to build the axes:
pos = [0.05,0.55,0.9,0.4];
Axis1 = axes;
p1 = semilogy(Axis1,wavelength,stokes,'linew',2);
Axis1.Position = pos;
Axis2=axes;
p2 = semilogy(Axis2,wavelength,repmat(gain,[1024,1]),'linew',2);
Axis2.Position = pos;
Axis2.Color='none';
linkaxes([Axis1,Axis2], 'x','y');
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2016년 8월 25일
Do not use linkaxes for this purpose. You might not be able to use data cursor itself at all. See https://www.mathworks.com/matlabcentral/answers/269093-firing-event-if-mouse-enters-graphic-objects-figure-axes-button-etc#answer_210628
... or possibly in your case all you will need to do is set hittest (or possibly the new pickableparts) to off on the top axes.

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by