'Remove or change background border line color
I have plotted an image with matplotlib and changed the background facecolor
to gray
, however there is this white
border line around the background. I have tried to set the edgecolor
to gray
but still this white
border line appears as shown in the image below. Is there any way to remove or change the border color? Below is my plotting code.
im = ax.imshow(im, cmap='gray', aspect="auto", vmin=vmin, vmax=vmax)
plt.tick_params(labelsize=6)
for label in ax.get_xticklabels()+ax.get_yticklabels():
label.set_fontsize(6)
fig.patch.set_facecolor("#C0C0C0")
fig.patch.set_edgecolor("#C0C0C0")
plt.subplots_adjust(bottom=0.20,top=0.70,left=0.14,right=0.85)
plt.savefig(SavePath+'Image', facecolor=fig.get_facecolor(), transparent=True)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|