Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions galleries/examples/pyplots/pyplot_simple.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
"""
===========
Simple plot
===========
==========
Basic plot
==========

A simple plot where a list of numbers are plotted against their index,
resulting in a straight line. Use a format string (here, 'o-r') to set the
markers (circles), linestyle (solid line) and color (red).
A basic plot using the :ref:`pyplot_interface`.

- `~.pyplot.plot` plots the data y versus x as lines and/or markers.
- `~.pyplot.title`, `~.pyplot.xlabel` and `~.pyplot.ylabel` set the title,
x-axis label and y-axis label.
- `~.pyplot.show` displays the plot.

.. redirect-from:: /gallery/pyplots/fig_axes_labels_simple
.. redirect-from:: /gallery/pyplots/pyplot_formatstr
.. redirect-from:: /gallery/pyplots/pyplot_text
"""

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(0.0, 2.0, 0.01)
y = np.sin(2 * np.pi * x)

plt.plot([1, 2, 3, 4], 'o-r')
plt.ylabel('some numbers')
plt.plot(x, y)
plt.title("A basic plot using pyplot")
plt.xlabel('Time [s]')
plt.ylabel('Voltage [mV]')
plt.show()

# %%
Expand All @@ -25,5 +35,7 @@
# in this example:
#
# - `matplotlib.pyplot.plot`
# - `matplotlib.pyplot.title`
# - `matplotlib.pyplot.ylabel`
# - `matplotlib.pyplot.ylabel`
# - `matplotlib.pyplot.show`
41 changes: 0 additions & 41 deletions galleries/examples/pyplots/pyplot_text.py

This file was deleted.

Loading