来自一个Python新手,CSDN新手的处女作
matplotlib画图很方便,但是可能会出现一些意料之外的事情,如图像重叠等。
出现这种情况,可以使用plt.subplot_adjust函数进行调整:
left : # the left side of the subplots of the figure
right : # the right side of the subplots of the figure
bottom: # the bottom of the subplots of the figure
top: # the top of the subplots of the figure
wspace : # the amount of width reserved for space between subplots,
# expressed as a fraction of the average axis width
hspace: # the amount of height reserved for space between subplots,
# expressed as a fraction of the average axis height
PS:这里需要多次调整,耐心等待哦!!
代码运行结果:
图像中的坐标轴还是不清晰,我曾尝试着放大图片,但是相应的图片的清晰度也会改变,后来才明白,坐标轴是根据图片的大小来规定的(觉得自己好傻!),所以利用plt.axis消除坐标轴:
代码运行结果:
美观了些许吧,哈哈T_T