1. Pyroom
  2. Tutorials
  3. Python libraries
  4. Plot a chart with matplotlib

Plot a chart with matplotlib

matplotlib turns lists of numbers into charts. The chart appears in the preview panel next to the console.

Intermediate Video coming soon. The steps below show everything the video will cover.

Steps

  1. Load matplotlib from Library settings first. It is bigger, so the first load takes a moment.
  2. Make two lists: the labels and the values.
  3. plt.bar draws the bars and plt.show displays the chart.
  4. Run it. The chart appears in the preview panel.
Read the transcript

Load matplotlib from Library settings first. It is bigger, so the first load takes a moment.

Make two lists: the labels and the values.

plt.bar draws the bars and plt.show displays the chart.

Run it. The chart appears in the preview panel.

More Python libraries tutorials

Python libraries → · All tutorials →

Try it in the Playground

Nothing to install and no account needed.

Open Playground →