Access the data of the axis behind another axis.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Walter Roberson
el 25 de Ag. de 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.
0 comentarios
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!