Data VisualizationBeginner
Run Matplotlib Online
Plot Python charts and graphs online with Matplotlib — no install, no signup. Free in-browser Matplotlib compiler with NumPy and pandas pre-loaded.
Try it yourself
Run this code directly in your browser. Click "Open in full editor" to experiment further.
Loading...
Click Run to see output
Or press Ctrl + Enter
How it works
Run Matplotlib Online
This example creates a side-by-side figure with two subplots — a sine wave and a cosine wave — using Matplotlib and NumPy together.
What's happening
np.linspace(0, 2*np.pi, 200) — generates 200 evenly spaced x values from 0 to 2πplt.subplots(1, 2) — creates a figure with 1 row and 2 columns of axesax.plot(x, y) — draws a line chart on each axisplt.tight_layout() — automatically adjusts spacing between subplotsplt.savefig(...) — saves the figure as a PNG imageplt.show() — renders the chart inline in the output panelKey Matplotlib concepts
| Operation | Code |
|---|---|
| Line chart | plt.plot(x, y) |
| Multiple plots | fig, axes = plt.subplots(rows, cols) |
| Labels | ax.set_title(), ax.set_xlabel() |
| Grid | ax.grid(True) |
| Save | plt.savefig('file.png') |
Matplotlib, NumPy, and pandas are all pre-loaded in PythonHere — no installation required.
Related examples
Data Science
Run Pandas Online
Run pandas DataFrames online with no install and no signup. Free in-browser Python pandas compiler with NumPy and Matplotlib pre-loaded.
Scientific Computing
NumPy Online Compiler
Run NumPy arrays and matrix operations online with no install and no signup. Free in-browser NumPy compiler with pandas and Matplotlib pre-loaded.