'Plotting border of masked array with plt.imshow
Actually plotting this image using plt.imshow
and np.masked
to plot the figure in blue. I would like to remove the inner part of the figure and just leaving the border. Tried with fill=False
but that's not an arg for plt.imshow
.
Code:
#img comes from a raster using GDAL
img = np.dstack((band1, band2, band3))
max = img.max()
img = img / max
one = f.add_subplot(1, 2, 1)
one.set_title('Polygon ID: '+index)
plt.imshow(img, cmap=plt.cm.binary)
plt.imshow(masked_polygon, 'jet', interpolation='none', alpha=0.3)
plt.axis('off')
Result of plot:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|