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 Center および File ExchangeGrid 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