.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "intro/matplotlib/auto_examples/exercises/plot_exercise_1.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end <sphx_glr_download_intro_matplotlib_auto_examples_exercises_plot_exercise_1.py>` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_1.py: Exercise 1 =========== Solution of the exercise 1 with matplotlib. .. GENERATED FROM PYTHON SOURCE LINES 7-18 .. image-sg:: /intro/matplotlib/auto_examples/exercises/images/sphx_glr_plot_exercise_1_001.png :alt: plot exercise 1 :srcset: /intro/matplotlib/auto_examples/exercises/images/sphx_glr_plot_exercise_1_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt n = 256 X = np.linspace(-np.pi, np.pi, 256) C, S = np.cos(X), np.sin(X) plt.plot(X, C) plt.plot(X, S) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.055 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_exercises_plot_exercise_1.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_exercise_1.ipynb <plot_exercise_1.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_exercise_1.py <plot_exercise_1.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_exercise_1.zip <plot_exercise_1.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_