.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_auto_examples_plot_python_101.py>`     to download the full example code or to run this example in your browser via Binder
    .. rst-class:: sphx-glr-example-title

    .. _sphx_glr_auto_examples_plot_python_101.py:


Basic numerics and plotting with Python
========================================

A simple example of basic Python numerics and how to
plot it.



.. image:: /auto_examples/images/sphx_glr_plot_python_101_001.png
    :alt: plot python 101
    :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 Out:

 .. code-block:: none


    [<matplotlib.lines.Line2D object at 0x7fbf2ac92a00>]





|


.. code-block:: default


    # import numpy: the module providing numerical arrays
    import numpy as np
    t = np.linspace(1, 10, 2000)

    # import matplotlib.pyplot: the module for scientific plotting
    import matplotlib.pyplot as plt
    plt.plot(t, np.cos(t))


.. rst-class:: sphx-glr-timing

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


.. _sphx_glr_download_auto_examples_plot_python_101.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example


  .. container:: binder-badge

    .. image:: images/binder_badge_logo.svg
      :target: https://mybinder.org/v2/gh/nilearn/nilearn.github.io/main?filepath=examples/auto_examples/plot_python_101.ipynb
      :alt: Launch binder
      :width: 150 px


  .. container:: sphx-glr-download sphx-glr-download-python

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



  .. container:: sphx-glr-download sphx-glr-download-jupyter

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


.. only:: html

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

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