antonin-lfv / 3D-plot-Python-interpolation

How to plot a 3D surface with python by interpolation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3D-surface-plot-Python

The n*m Z matrix can contain heights of water for example, to plot the submarine surface. If you have any question, tell me!

First setp

from LinearInterpolation3D import *
import pandas as pd
import numpy as np

if __name__ == "__main__":
    z_data = np.fromfunction(lambda x, y: np.sin(x/5)+np.cos(y/5)+0.1, (20, 20))
    mon_interpolateur = Interpolator(matrix=z_data)
    # With color gradient (unique plot)
    f1 = mon_interpolateur.graph_3D_color(display=False)  # display=True to juste plot this figure

    # With lines (unique plot)
    f2 = mon_interpolateur.graph_3D_line(display=False)

    # Subplot with gradient and lines
    mon_interpolateur.subplot_line_gradient()


About

How to plot a 3D surface with python by interpolation

License:MIT License


Languages

Language:Python 100.0%