<divid="unreleased-message"> You are reading an old version of the documentation (v2.2.4). For the latest version see <ahref="/stable/">https://matplotlib.org/stable/</a></div>
<pclass="last">Click <aclass="reference internal" href="#sphx-glr-download-gallery-api-image-zcoord-py"><spanclass="std std-ref">here</span></a> to download the full example code</p>
<spanid="sphx-glr-gallery-api-image-zcoord-py"></span><h1>Modifying the coordinate formatter<aclass="headerlink" href="#modifying-the-coordinate-formatter" title="Permalink to this headline">¶</a></h1>
<p>Modify the coordinate formatter to report the image "z"
<spanclass="c1"># Fixing random state for reproducibility</span>
<ahref="https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.seed.html#numpy.random.seed" title="View documentation for numpy.random.seed"><spanclass="n">np</span><spanclass="o">.</span><spanclass="n">random</span><spanclass="o">.</span><spanclass="n">seed</span></a><spanclass="p">(</span><spanclass="mi">19680801</span><spanclass="p">)</span>
<spanclass="n">X</span><spanclass="o">=</span><spanclass="mi">10</span><spanclass="o">*</span><ahref="https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html#numpy.random.rand" title="View documentation for numpy.random.rand"><spanclass="n">np</span><spanclass="o">.</span><spanclass="n">random</span><spanclass="o">.</span><spanclass="n">rand</span></a><spanclass="p">(</span><spanclass="mi">5</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">)</span>
<spanclass="n">fig</span><spanclass="p">,</span><spanclass="n">ax</span><spanclass="o">=</span><ahref="../../api/_as_gen/matplotlib.pyplot.subplots.html#matplotlib.pyplot.subplots" title="View documentation for matplotlib.pyplot.subplots"><spanclass="n">plt</span><spanclass="o">.</span><spanclass="n">subplots</span></a><spanclass="p">()</span>
<ahref="../../api/_as_gen/matplotlib.pyplot.show.html#matplotlib.pyplot.show" title="View documentation for matplotlib.pyplot.show"><spanclass="n">plt</span><spanclass="o">.</span><spanclass="n">show</span></a><spanclass="p">()</span>
</pre></div>
</div>
<divclass="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-gallery-api-image-zcoord-py">