.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_ts.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_ts.py: ====================== Plotting a time series ====================== Visualizing data is important and should usually be the first step in any analysis. This simple example shows how to plot a single time series. .. GENERATED FROM PYTHON SOURCE LINES 9-30 .. image-sg:: /auto_examples/images/sphx_glr_plot_ts_001.png :alt: Plotting a time series :srcset: /auto_examples/images/sphx_glr_plot_ts_001.png :class: sphx-glr-single-img .. code-block:: default # Author: Johann Faouzi # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as plt # Parameters n_samples, n_timestamps = 100, 48 # Toy dataset rng = np.random.RandomState(41) X = rng.randn(n_samples, n_timestamps) # Plot the first time series plt.figure(figsize=(6, 5)) plt.plot(X[0], 'o-') plt.xlabel('Time', fontsize=14) plt.title('Plotting a time series', fontsize=16) plt.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.260 seconds) .. _sphx_glr_download_auto_examples_plot_ts.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_ts.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ts.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_