
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/plot_command_line_args.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

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

        Click :ref:`here <sphx_glr_download_auto_examples_plot_command_line_args.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_command_line_args.py:


Command line arguments support
==============================

Use command line arguments to control example script.

.. GENERATED FROM PYTHON SOURCE LINES 7-19



.. image:: /auto_examples/images/sphx_glr_plot_command_line_args_001.png
    :alt: plot command line args
    :class: sphx-glr-single-img





.. code-block:: python3


    import sys

    import numpy as np
    import matplotlib.pyplot as plt

    if len(sys.argv) > 1 and sys.argv[1] == 'plot':
        fig_0, ax_0 = plt.subplots(figsize=(5, 1))

        x = np.arange(0, 10., 1)
        ax_0.plot(x, x**2)
        plt.show()


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

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


.. _sphx_glr_download_auto_examples_plot_command_line_args.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/sphinx-gallery/sphinx-gallery.github.io/master?urlpath=lab/tree/notebooks/auto_examples/plot_command_line_args.ipynb
      :alt: Launch binder
      :width: 150 px


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

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



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

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


.. only:: html

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

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