Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Superimpose figures
#1
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
Quote
#2
What actually happens now?
Quote
#3
interesting query
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to superscript figures? Felipe 0 1,102 Feb-06-2017, 05:56 PM
Last Post: Felipe

Forum Jump:


Users browsing this thread: 1 Guest(s)