.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/zorder.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__auto_examples_zorder.py: Zorder Example ===================================== Zorder controls the drawing order of plot elements. Elements with higher zorder values are drawn on top of those with lower values. This example demonstrates how to use zorder to control a plot call resulting betwenn gridlines and other plot calls. .. GENERATED FROM PYTHON SOURCE LINES 8-30 .. image-sg:: /_auto_examples/images/sphx_glr_zorder_001.png :alt: zorder :srcset: /_auto_examples/images/sphx_glr_zorder_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import sysplot as ssp ssp.apply_config(seaborn_style="darkgrid") fig, ax = plt.subplots() # should be above gridlines, but below plt.plot() ssp.emphasize_coord_lines(fig) # uses zorder =1 # should be the same as emphasize_coord_lines. ssp.plot_unit_circle(ax=ax, zorder=1.5, label="Zorder 1") # should be above both gridlines and emphasize_coord_lines but below plt.plot() ssp.add_tick_line(value=0.5, label="Zorder 1", axis=ax.xaxis, zorder=1) # default zorder. plt.plot([-1, 1], [-1, 1], label="Default zorder") plt.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.224 seconds) .. _sphx_glr_download__auto_examples_zorder.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: zorder.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: zorder.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: zorder.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_