标签: python matplotlib
我想要旋转的白色背景图像。但是,旋转会在图像周围创建不需要的边框(不是轴,而是下方铅笔周围的灰色轮廓)。如何删除此边框?
fig,ax = plt.subplots(figsize=(8,6)) pencil = mpimg.imread('Pencil.jpg') pencil = ndimage.rotate(pencil,105) ax.imshow(pencil,aspect='equal')
答案 0 :(得分:3)
Matplotlib plots: removing axis, legends and white spaces
使用mpimg.axis('off')
mpimg.axis('off')
另见matplotlib文档:
http://matplotlib.org/api/axis_api.html