为了账号安全,请及时绑定邮箱和手机立即绑定

matplotlib 子图未显示

matplotlib 子图未显示

交互式爱情 2022-10-25 10:57:44
右列图没有出现,知道发生了什么吗?我可以将它们堆叠在一起,但是当我尝试制作两列时,右侧的列不显示。另外,当我尝试使用 %matplotlib 笔记本时,该数字完全消失了。我已经包含了我的身材的屏幕截图。%matplotlib inline# RING 1 PLOTSfig, axs = plt.subplots(6, 2)fig = plt.figure(figsize=(20,20))axs[0,0].plot(t, ring.IN_1.soma_v, color='black', label='IN soma')axs[0,0].plot(t, ring.IN_1.dend_prox_v, color='grey', label='IN prox dend')axs[0,0].plot(t, ring.IN_1.dend_dist_v, color='red', label='IN dist dend')axs[0,0].plot(t, ring.IN_1.dend_dist2_v, color='blue', label='IN dist2 dend')axs[0,0].legend(loc='upper right', frameon=False)axs[0,0].set_ylabel('mV')axs[0,0].set_xticks([])axs[0,0].set_xlim([50,300])axs[0,0].set_ylim([-100,50])axs[1,0].plot(t, ring.TCcells[0].soma_v, color='black', label='TC1 soma')axs[1,0].plot(t, ring.TCcells[0].dend_prox_v, color= 'grey', label='TC1 dend')axs[1,0].legend(frameon = False)axs[1,0].set_ylabel('mV')axs[1,0].set_xticks([])axs[1,0].set_xlim([50,300])axs[1,0].set_ylim([-100,50])axs[2,0].plot(t, ring.TCcells[1].soma_v, color='black', label='TC2 soma')axs[2,0].plot(t, ring.TCcells[1].dend_prox_v, color= 'grey', label='TC2 dend')axs[2,0].legend(frameon = False)axs[2,0].set_ylabel('mV')axs[2,0].set_xticks([])axs[2,0].set_xlim([50,300])axs[2,0].set_ylim([-100,50])axs[3,0].plot(t, ring.TCcells[2].soma_v, color='black', label='TC3 soma')axs[3,0].plot(t, ring.TCcells[2].dend_prox_v, color= 'grey', label='TC3 dend')axs[3,0].legend(frameon = False)axs[3,0].set_ylabel('mV')axs[3,0].set_xticks([])axs[3,0].set_xlim([50,300])axs[3,0].set_ylim([-100,50])axs[4,0].plot(t, ring.TCcells[3].soma_v, color='black', label='TC4 soma')axs[4,0].plot(t, ring.TCcells[3].dend_prox_v, color= 'grey', label='TC4 dend')axs[4,0].legend(frameon = False)axs[4,0].set_ylabel('mV')axs[4,0].set_xticks([])axs[4,0].set_xlim([50,300])axs[4,0].set_ylim([-100,50])
查看完整描述

1 回答

?
开满天机

TA贡献1786条经验 获得超13个赞

您正在使用plt.show() 两次。删除第一个并在绘制所有图形后plt.show()只使用一次。


axs[5,0].set_ylim([-100,50])

plt.show()    # <------------------ Remove this one


# RING 2 PLOTS

axs[0,1].plot(t, ring2.IN_1.soma_v, color='black', label='IN soma')

.

.

.

axs[5,1].set_ylim([-100,50])

plt.show()    # <------------------ Use only this one

也尝试更换


fig, axs = plt.subplots(6, 2)

fig = plt.figure(figsize=(20,20))

经过


fig, axs = plt.subplots(6, 2, figsize=(20,20))


查看完整回答
反对 回复 2022-10-25
  • 1 回答
  • 0 关注
  • 92 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信