.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "intro/matplotlib/auto_examples/plot_ugly.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_plot_ugly.py: A example of plotting not quite right ====================================== An "ugly" example of plotting. .. GENERATED FROM PYTHON SOURCE LINES 7-28 .. image-sg:: /intro/matplotlib/auto_examples/images/sphx_glr_plot_ugly_001.png :alt: plot ugly :srcset: /intro/matplotlib/auto_examples/images/sphx_glr_plot_ugly_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt matplotlib.rc("grid", color="black", linestyle="-", linewidth=1) fig = plt.figure(figsize=(5, 4), dpi=72) axes = fig.add_axes((0.01, 0.01, 0.98, 0.98), facecolor=".75") X = np.linspace(0, 2, 40) Y = np.sin(2 * np.pi * X) plt.plot(X, Y, lw=0.05, c="b", antialiased=False) plt.xticks([]) plt.yticks(np.arange(-1.0, 1.0, 0.2)) plt.grid() ax = plt.gca() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.027 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_plot_ugly.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ugly.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_ugly.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_ugly.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_