Command line arguments support

Use command line arguments to control example script.

plot command line args
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()

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

Gallery generated by Sphinx-Gallery