Python Forum
Superimpose figures - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Superimpose figures (/thread-718.html)



Superimpose figures - Scientifix - Oct-31-2016

Hello,
I have the following code :
from scipy.spatial import ConvexHull
from scipy.spatial import convex_hull_plot_2d
import matplotlib.pyplot as plt
import numpy as np

points = np.random.rand(30, 2)

Plot = True

def min_convex(points):
 
    oignon_layers = []    
 
    while len(points) >= 4:
        layer = ConvexHull(points)
        oignon_layers.append(layer)
        points = np.delete(points, layer.vertices, axis=0)
        
    if Plot == True:
        plt.plot(points[:,0], points[:,1], 'o')
        for layer in oignon_layers:
            convex_hull_plot_2d(layer)
    plt.show()
And I would like to superimpose all figures on one (having all points and convex layers on one figure)
What should I do ?
Thanks

PS: for convex hulls : https://docs.scipy.org/doc/scipy/reference/spatial.html


RE: Superimpose figures - nilamo - Nov-07-2016

What actually happens now?


RE: Superimpose figures - Nitram - Aug-16-2019

interesting query