如何解决带有使用不同绘图类型的子图的图
如何使用不同的绘图类型(线、散点等)绘制具有多个子图的图形?
尝试使用 plt.scatter 或 plot.scatter 或其他时,出现错误:
'AxesSubplot' 对象没有属性 'plt'
如何在此处启动属性?
当使用“正常”绘图轴 [2].plot(kind='scatter') 作为属性时,出现错误:
未知的属性类型
当三个子图中的每一个都统一使用axes.plot(x,y,....)时,它们会很好地显示为线图
fig,axes = plt.subplots(nrows=1,ncols=3,figsize=(21,4))
fig = plt.figure()
axes[0].plot(dur_d,inter_d,color='purple',lw=0.5,alpha=0.5,linestyle='dashed',marker='+',markersize=10,markeredgecolor='red',markeredgewidth=3) # RGB Hex Code
axes[0].set_xlabel('Duration')
axes[0].set_ylabel('Interest')
axes[0].set_title('Interest on different loan durations')
axes[1].plot(amount_a,inter_a,alpha=1,markersize=1,markeredgewidth=1) # RGB Hex Code
axes[1].set_xlabel('Loan amount')
axes[1].set_ylabel('Interest')
axes[1].set_title('Interest on different loan amounts')
axes[2].plt.scatter(ltv_l,inter_l,color='purple') # RGB Hex Code
axes[2].set_xlabel('LTV')
axes[2].set_ylabel('Interest')
axes[2].set_title('Interest on different LTV')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。