

.. _sphx_glr_auto_examples_plot_exp.py:


Plotting the exponential function
=================================

A simple example for ploting two figures of a exponential
function in order to test the autonomy of the gallery
stacking multiple images.




.. rst-class:: sphx-glr-horizontal


    *

      .. image:: /auto_examples/images/sphx_glr_plot_exp_001.png
            :scale: 47

    *

      .. image:: /auto_examples/images/sphx_glr_plot_exp_002.png
            :scale: 47





.. code-block:: python


    # Code source: Óscar Nájera
    # License: BSD 3 clause

    import numpy as np
    import matplotlib.pyplot as plt


    def main():
        x = np.linspace(-1, 2, 100)
        y = np.exp(x)

        plt.figure()
        plt.plot(x, y)
        plt.xlabel('$x$')
        plt.ylabel('$\exp(x)$')

        plt.figure()
        plt.plot(x, -np.exp(-x))
        plt.xlabel('$x$')
        plt.ylabel('$-\exp(-x)$')

        plt.show()

    if __name__ == '__main__':
        main()

**Total running time of the script:** ( 0 minutes  0.201 seconds)



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

     :download:`Download Python source code: plot_exp.py <plot_exp.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: plot_exp.ipynb <plot_exp.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
