Catalog
1. 1. Python #Plot
3D contour plot via Mayavi

# Python #Plot

Recently I am interested in the data visualization and I have try different plots. Previously in my research work I ploted a 3d contour figure via MATLAB. Since the frequently used Python package Matplotlib has poor support on this kind of 3d data visualization. I also tried the Mayavi package before and I didn’t learn it well.

After reading a lot of examples I begin to control the skill of using Mayavi. I try to replot the original plots via python.

Here is the process. We first need import the necessary package

Then the 3d data should be prepared. The data are calculated via parameter sweep and store with txt format. We need load it

We need transpose the matrix since I need kappa to be the z axi

Then we can plot the 3d data

I have used the function contour3d and its usage can be found in the mayavi doc web.

The following is the figure I plotted.

Author: Knifelee
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment