Image and Voronoi diagram on the same figure
问题 I need to plot a Voronoi tessellation on top of an existing image using scipy.spatial.Voronoi . I have imported an image as a numpy array using matplotlib.pyplot : img_file = 'my_image.png' img = plt.imread(os.path.join(data_dir, img_file)) fig = plt.figure() ax = fig.add_subplot(111) When I display the image it works ok: ax.imshow(img) my initial image Then I want to add a Voronoi graph (for some points I choose arbitrarily) on it so I do: points = np.array([[0, 0], [0, 1], [0, 2], [1, 0],