Access the data of the axis behind another axis.

2 次查看(过去 30 天)
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 中查找有关 Graphics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by