Only one y-axis of two updates when graph zoomed in on
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Joseph Cunningham
am 7 Okt. 2022
Beantwortet: Narvik
am 5 Sep. 2023
Hello,
I am generating graphs from multiple variables relative to the same x-axis. The output plots look good (see LHS example), but when I attempt to zoom in on a portsion of the graph, the LHS y-axis and x-axis update to the modified values within visual range, while the RHS y-axis values remain static as before the zoom, making it difficult to determine values from the zoomed-in graph. How can I remedy this issue? See attached graphics:
Thanks,
Joseph
Akzeptierte Antwort
Narvik
am 5 Sep. 2023
Hi,
I understand that you want x and y axes of both of your subplots to be updated when zoomed in.
This can be done either by using “linkaxes” or “linkprop” functions.
Please find the code for linking x and y axes of two subplots below:
% Here, ax1 and ax2 are
% axes of the two subplots.
% Using 'linkaxes' function.
linkaxes([ax1, ax2], 'xy');
% Using 'linkprop' function.
linkprop([ax1, ax2], {'XLim', 'YLim'});
For more information on the “linkaxes” and “linkprop” functions, you can refer to the following documentation:
Hope this helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!