Skip to content

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()