.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "plot_types/basic/line.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_plot_types_basic_line.py: Line Plot --------- Below is an example of how to plot a basic line plot using EMCPy's plotting method. .. GENERATED FROM PYTHON SOURCE LINES 9-47 .. image-sg:: /plot_types/basic/images/sphx_glr_line_001.png :alt: Line Plot :srcset: /plot_types/basic/images/sphx_glr_line_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from emcpy.plots.plots import LinePlot from emcpy.plots.create_plots import CreatePlot, CreateFigure def main(): x = [1, 2, 3, 4, 5] y = [1, 2, 3, 4, 5] # Create line plot object lp = LinePlot(x, y) lp.label = 'line' # Add line plot object to list plt_list = [lp] # Create plot object and add features plot1 = CreatePlot() plot1.plot_layers = [lp] plot1.add_title('Line Plot') plot1.add_xlabel('X Axis Label') plot1.add_ylabel('Y Axis Label') plot1.add_legend(loc='upper right') # Create figure fig = CreateFigure() fig.plot_list = [plot1] fig.create_figure() plt.show() if __name__ == '__main__': main() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.067 seconds) .. _sphx_glr_download_plot_types_basic_line.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: line.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: line.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_