Oct-31-2016, 04:10 PM
Hello,
I have the following code :
What should I do ?
Thanks
PS: for convex hulls : https://docs.scipy.org/doc/scipy/reference/spatial.html
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