{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Simple plot\n\nA simple plot where a list of numbers are plotted against their index,\nresulting in a straight line. Use a format string (here, 'o-r') to set the\nmarkers (circles), linestyle (solid line) and color (red).\n\n.. redirect-from:: /gallery/pyplots/fig_axes_labels_simple\n.. redirect-from:: /gallery/pyplots/pyplot_formatstr\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n\nplt.plot([1, 2, 3, 4], 'o-r')\nplt.ylabel('some numbers')\nplt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ".. admonition:: References\n\n The use of the following functions, methods, classes and modules is shown\n in this example:\n\n - `matplotlib.pyplot.plot`\n - `matplotlib.pyplot.ylabel`\n - `matplotlib.pyplot.show`\n\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.2" } }, "nbformat": 4, "nbformat_minor": 0 }