Why eps format ignores some of the subplot frames in matplotlib

144 Views Asked by At

I am trying to plot 14 subplots but when I saved the plot I noticed that all the outer frames of the second column has been ignored. You can see the image and my code below.

import numpy as np
from matplotlib import pyplot as plt

a=np.random.rand(14,100)

x = np.arange(0,100)

plt.rcParams['figure.autolayout'] = True

fig, axs = plt.subplots(7, 2,figsize=(11,22))

axs[0, 0].plot(x, a[0,:], color='black')
axs[0, 1].plot(x, a[1,:], color='black')
axs[1, 0].plot(x, a[2,:], color='black')
axs[1, 1].plot(x, a[3,:], color='black')
axs[2, 0].plot(x, a[4,:], color='black')
axs[2, 1].plot(x, a[5,:], color='black')
axs[3, 0].plot(x, a[6,:], color='black')
axs[3, 1].plot(x, a[7,:], color='black')
axs[4, 0].plot(x, a[8,:], color='black')
axs[4, 1].plot(x, a[9,:], color='black')
axs[5, 1].plot(x, a[10,:], color='black')
axs[5, 0].plot(x, a[11,:], color='black')
axs[6, 0].plot(x, a[12,:], color='black')
axs[6, 1].plot(x, a[13,:], color='black')



for ax in axs.flat:
    ax.set(xlabel='Time (s)', ylabel= 'Load (kN)')
    
for row in axs: 
    for ax in row: 
        ax.grid(b=True, which='major', color='#666666', linestyle='-')    
       
plt.savefig("test.eps", dpi=1200)
plt.show()    


enter image description here

0

There are 0 best solutions below