Skip to content
Home » matplotlib Part 1 – Introduction to Matplotlib

matplotlib Part 1 – Introduction to Matplotlib

Spread the love

Matplotlib is a cross-platform data visualization library. It’s used to visualize data and the results of all sorts of computations. Matplotlib is mainly used for static 2D and 3D graphs.

Its capabilities are huge, of which we’re only going to cover the basics in this series. We’ll use quite a lot of different types of plots, like line plots, bar plots, colormap plots, contour plots or 3D surface plots.

Matplotlib supports a variety of output formats. You are also in full control of the appearance of the graphs and the elements that should be visible on the graph, like annotations, scales, legends and so on. Matplotlib is used to make publication-ready figures.

If you want to learn more about the library, in particular read the current documentation, you should visit the matplotlib.org website. There you can also find lots of interesting examples and tutorials. Here’s what it looks like at the time of writing:

matplotlib website

In this series we’ll be using the Jupyter Notebook environment. If you want to follow along, make sure you have matplotlib and the environment installed. You already have it if you have the Anaconda distribution of Python.

Opening Jupyter Notebook

You can open Jupyter Notebook from the Anaconda Prompt terminal by typing the following:

open Jupyter Notebook

This will open Jupyter:

Jupyter Notebook

You will see it in your browser at localhost:8888:

In this series we want each part to have its own notebook, so let’s create a folder where we will store them all. To do that, click on New and select Folder:

new folder

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

Let’s rename the folder matplotlib. First select the folder (A) and then hit Rename (B):

rename folder

Now a popup window will show. Enter the new name (A) and hit the Rename button (B):

rename popup

Now you can see the renamed folder in the list:

renamed folder

We are ready to start coding. In the next lecture we’ll write some simple code using Matplotlib just to see what modules we need and how the code is organized.

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.

Here’s the video version of the article:


Spread the love

Leave a Reply