Azzera filtri
Azzera filtri

Access the data of the axis behind another axis.

1 visualizzazione (ultimi 30 giorni)
amin rasoulof
amin rasoulof il 25 Ago 2016
Risposto: Walter Roberson il 25 Ago 2016
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

Risposte (1)

Walter Roberson
Walter Roberson il 25 Ago 2016
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.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by