.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "intro/matplotlib/auto_examples/options/plot_solid_capstyle.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_intro_matplotlib_auto_examples_options_plot_solid_capstyle.py: Solid cap style ================ An example demoing the solide cap style in matplotlib. .. GENERATED FROM PYTHON SOURCE LINES 7-32 .. image-sg:: /intro/matplotlib/auto_examples/options/images/sphx_glr_plot_solid_capstyle_001.png :alt: plot solid capstyle :srcset: /intro/matplotlib/auto_examples/options/images/sphx_glr_plot_solid_capstyle_001.png :class: sphx-glr-single-img .. code-block:: default import numpy as np import matplotlib.pyplot as plt size = 256, 16 dpi = 72.0 figsize= size[0] / float(dpi), size[1] / float(dpi) fig = plt.figure(figsize=figsize, dpi=dpi) fig.patch.set_alpha(0) plt.axes([0, 0, 1, 1], frameon=False) plt.plot(np.arange(4), np.ones(4), color="blue", linewidth=8, solid_capstyle='butt') plt.plot(5 + np.arange(4), np.ones(4), color="blue", linewidth=8, solid_capstyle='round') plt.plot(10 + np.arange(4), np.ones(4), color="blue", linewidth=8, solid_capstyle='projecting') plt.xlim(0, 14) plt.xticks([]) plt.yticks([]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.014 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_options_plot_solid_capstyle.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_solid_capstyle.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_solid_capstyle.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_