From 3D Contour Plots to AI-Generated Art

Vincent Granville
2 min readOct 24, 2022

Fun tutorial to learn how to make professional contour plots in Python, with incredible animated visualizations. At the intersection of machine learning, scientific computing, automated art, cartography, and video games. Section 3 is particularly interesting, as it shows all the work behind the scene, to complete this project in 20 hours when you have no idea how to start.

There is far more than just creating 3D contour plots in this article. First, you will learn how to produce data videos. I have shared quite a few in the past (with source code), but this is probably the simplest example. The data video also illustrates that a mixture of Gaussian-like distributions is typically non Gaussian-like, and may or may not be unimodal. It is borderline art (automatically generated), and certainly a stepping stone for professionals interested in computer vision or designing video games. It is easy to image a game based on my video, entitled “flying above menacingly rising mountains”.

Then the data video, through various rotations, give you a much better view of your data. It is also perfect to show systems that evolve over time: a time series where each observation is an image. In addition, unlike most tutorials found online, this one does a rather deep dive on a specific, rather advanced function from a library truly aimed at scientific computing.

In the same way that images (say pictures of hand-written digits) can be summarized by 10 parameters to perform text recognition, here 20 parameters allow you to perform topography classification. Not just of static terrain, but terrain that changes over time, assuming you have access to 50,000 videos representing different topographies. You can produce the videos needed for supervised classification with the code in section 2. The next step is to use data (videos) from the real world, and used the model trained on synthetic data for classification.

Read the full article with illustration (data video) and Python code, here.

--

--

Vincent Granville

Founder, MLtechniques.com. Machine learning scientist. Co-founder of Data Science Central (acquired by Tech Target).