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 axes
  • ax.plot(x, y) — draws a line chart on each axis
  • plt.tight_layout() — automatically adjusts spacing between subplots
  • plt.savefig(...) — saves the figure as a PNG image
  • plt.show() — renders the chart inline in the output panel
  • Key Matplotlib concepts

    OperationCode
    Line chartplt.plot(x, y)
    Multiple plotsfig, axes = plt.subplots(rows, cols)
    Labelsax.set_title(), ax.set_xlabel()
    Gridax.grid(True)
    Saveplt.savefig('file.png')
    Matplotlib, NumPy, and pandas are all pre-loaded in PythonHere — no installation required.

    Related examples