Plotting “large” image with points with matplotlib - MemoryError

المشرف العام

Administrator
طاقم الإدارة
I want to plot an image of 3193 x 3293 pixels with 1502 points. When running in a smaller image and less points (934,722 pixels and 60 points), everything runs perfectly.

I wrote like this:

# I am just giving the general characteristics of the data; img = numpy.ndarray, dtype = uint8, shape = (3193,3293) points = numpy.ndarray, dtype = int32, shape = (1502,2)plt.imshow(img, cmap=plt.cm.gray_r)plt.autoscale(False)plt.plot(points[:, 1], points[:, 0], 'r.', markersize = 15)plt.axis('off')plt.show()Is there any other way to do this without using that much memory?

Thanks for the attention.



أكثر...
 
أعلى