In addition to the solution provided by Jonas, I think it's also worth mentioning the lower-level linkprop , which is capable of linking seemingly arbitrary properties of graphic objects.
For this particular question, the desired effect can be achieved using the following sequence of commands:
linkaxes([h1 h2 h3 h4], 'x'); lnkObj = linkprop([h1 h3], 'YLim');
For demo purposes (and because linkprop to me), this example is extremely simple. See the documentation and a more complex example for more details.
It can also be noted that linkprop returns a link object that (according to the previous link) should exist within the context in which you want the property connection to happen "; in particular, it seems that the connection will stop if all links to the link object disappear, reason why the target object reference variable above Furthermore, a reference to the created object communication is necessary to change the details of how the associated related graphical objects (i.e., objects have properties associated data object reference). cm. Updating ekta binding for more information (including a list of features specifically designed to perform such updates).
source share