title: Behaviour of axis properties with 'yyaxis'
body: <p>Create a figure with two y-axes, using <a href="https://www.mathworks.com/help/matlab/ref/yyaxis.html" rel="nofollow noreferrer"><code>yyaxis</code></a>:</p>
  
  <pre><code>figure
  yyaxis left
  hl = plot([0 10],[0 10],'-');
  yyaxis right
  hr = plot([0 10],[10 0],'--');
  </code></pre>
  
  <p>The following curious behaviour has been found. This has been tested in R2017b and in R2019a on Windows 10.</p>
  
  <p>The objects <code>hl</code> and <code>hr</code> seem to belong to the <strong>same axis</strong> (that is, <code>yyaxis</code> does not create a new axis):</p>
  
  <pre><code>&gt;&gt; get(hr, 'parent')==get(hl, 'parent')
  ans =
    logical
     1
  </code></pre>
  
  <p>However, the <code>'children'</code> property of the axis <strong>only reflects one object</strong>:</p>
  
  <pre><code>&gt;&gt; get(get(get(hl, 'parent'), 'children'), 'LineStyle')
  ans =
      '--'
  &gt;&gt; get(get(get(hr, 'parent'), 'children'), 'LineStyle')
  ans =
      '--'
  </code></pre>
  
  <p>Also, the <code>YAxisLocation'</code> property of the parent axis has <strong>the same value</strong> for both objects:</p>
  
  <pre><code>&gt;&gt; get(get(hl, 'parent'), 'YAxisLocation')
  ans =
      'right'
  &gt;&gt; get(get(hr, 'parent'), 'YAxisLocation')
  ans =
      'right'
  </code></pre>
  
  <p>If we now click on the solid line, to make it the current object,</p>
  
  <pre><code>&gt;&gt; get(get(get(gco, 'parent'), 'children'), 'LineStyle')
  ans =
      '-'
  &gt;&gt; get(get(get(hl, 'parent'), 'children'), 'LineStyle')
  ans =
      '-'
  &gt;&gt; get(get(get(hr, 'parent'), 'children'), 'LineStyle')
  ans =
      '-'
  &gt;&gt; get(get(gco, 'parent'), 'YAxisLocation')
  ans =
      'left'
  </code></pre>
  
  <p>Similarly, if we now click on the dotted line,</p>
  
  <pre><code>&gt;&gt; get(get(get(gco, 'parent'), 'children'), 'LineStyle')
  ans =
      '--'
  &gt;&gt; get(get(get(hl, 'parent'), 'children'), 'LineStyle')
  ans =
      '--'
  &gt;&gt; get(get(get(hr, 'parent'), 'children'), 'LineStyle')
  ans =
      '--'
  &gt;&gt; get(get(gco, 'parent'), 'YAxisLocation')
  ans =
      'right'
  </code></pre>
  
  <p>As a check,</p>
  
  <pre><code>&gt;&gt; get(gcf, 'children')
  </code></pre>
  
  <p>gives only one axis too, and</p>
  
  <pre><code>&gt;&gt; get(get(gcf, 'children'), 'children')
  </code></pre>
  
  <p>behaves similarly: only the object that was plotted last, or thas has been made current, is listed.</p>
  
  <p>The above behaviour can be <strong>summarized</strong> as follows:</p>
  
  <ul>
  <li>There is <strong>only one</strong> axis (and the <code>'parent'</code> property of all objects refers to that axis, as expected).</li>
  <li>The <code>'children'</code> property of the axis lists <strong>only one object</strong>, namely the current object, or the object that was plotted last.</li>
  <li>The <code>'YAxisLocation'</code> property of the axis <strong>dynamically changes</strong> between <code>'left'</code> and <code>'right'</code>. Again, this is determined by the current object, or the object that was plotted last.</li>
  </ul>
  
  <p>It's not clear how to make sense of this behaviour. The following <strong>questions</strong> naturally arise: </p>
  
  <ul>
  <li>Is this documented somewhere?</li>
  <li>How can two objects have the same axis as <code>'parent'</code>, but that axis only has the current object as <code>'children'</code>?</li>
  <li>Why does the <code>'YAxisLocation'</code> also change depending on which the current object is?</li>
  </ul>