Reputation: 65
I have an image with a white background that I would like to rotate. The rotation, however, creates an unwanted border around the image (not the axes, but the grey outline around the pencil below). How can I remove this border?
fig,ax = plt.subplots(figsize=(8,6))
pencil = mpimg.imread('Pencil.jpg')
pencil = ndimage.rotate(pencil,105)
ax.imshow(pencil,aspect='equal')
Upvotes: 1
Views: 219
Reputation: 243
Matplotlib plots: removing axis, legends and white spaces
Use mpimg.axis('off')
See also the matplotlib documentation:
http://matplotlib.org/api/axis_api.html
Upvotes: 3