.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/path_effects/test_pe.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_examples_path_effects_test_pe.py: ==================== Test PathEffects ==================== .. GENERATED FROM PYTHON SOURCE LINES 7-34 .. image-sg:: /examples/path_effects/images/sphx_glr_test_pe_001.png :alt: test pe :srcset: /examples/path_effects/images/sphx_glr_test_pe_001.png :class: sphx-glr-single-img .. code-block:: Python import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns # Create the data : copied from examples/kde_ridgeplot.py rs = np.random.RandomState(1979) x = rs.randn(100) fig, ax = plt.subplots(1, 1, num=1, clear=True) sns.kdeplot(x, fill=True, lw=2, ec="r") ax.set_ylim(ymin=-0.02) from mpl_visual_context.patheffects import Partial, Open p = ax.collections[0] # The 1st half of the path is the bottom line, thus we only strke the 2nd half, # and do not close the path. p.set_path_effects([Partial(0.5, 1.0) | Open()]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.082 seconds) .. _sphx_glr_download_examples_path_effects_test_pe.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: test_pe.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: test_pe.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: test_pe.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_