关于使用matplotlib画图出现的图像重叠现象解决方法

来自一个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

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值