python matplotlib作图无法铺满qt5界面

matplotlib.pyplot.figure(1)
for i in range(0,int(code_num)):
    j = 1 +2i
    k = 2+2
i
    stock_code = input('请输入第%s个代码:'%(i+1))    
            data1 = data_sec(stock_code,date,begin_time,end_time)
            names[f'ax{j}'] = matplotlib.pyplot.subplot(2code_num,1,j)
            names[f'ax{j}'].plot( data1.index, data1['fPrice'],color = 'g',linewidth = 1)
            names[f'ax{k}'] = matplotlib.pyplot.subplot(2
code_num,1,k)
            names[f'ax{k}'].bar( data1.index, data1['total_amount'],color = 'r')
            names[f'ax{k}'].plot(data1.index,data1['0'],linewidth = 0.5)
无需在意data_sec,只是为啥这样循环做出来的图始终无法铺满整个界面

放完整代码