3D plotting with Matplotlib

MIKE ARMISTEAD
2 min readJun 7, 2020

--

I wanted to get into 3D modeling but I didn’t know where to start. So I am starting with the basics and using the first visualization tool that I learned, Matplotlib.

The first thing that you’ll need to do is import all of the correct libraries. Since I usually use Matplot for graphs and 2D visualization I always add %matplotlib inline but because we will be working with 3D models you will want to use %matplotlib notebook so you can zoom in and out and rotate it to look at it from different angles.

I also imported Pandas and Numpy because once I get the basics downI want to be able to play around with a topography dataset. First thing I did was look at an empty 3D graphy so I understand where we are starting.

All we had to do differently is add projection=’3d’ Besides that it’s pretty basic and looks just like a 2D graph, it just added a z axis. Now that we know what it looks lets look at the different type of graphs we can use in 3D.

Line & Scatter Plots

Very similar to 2D but has an extra axis

Wireframe

Surface

TriSurface

Contour

--

--

MIKE ARMISTEAD
MIKE ARMISTEAD

Written by MIKE ARMISTEAD

Tech recruiter turned Data Scientist

No responses yet