I would like to implement this code, which regards the visualization of some data.
In particular, I have to produce 10 plots that have the same structure as the code below. The only difference between them is the range of x.
In plot n.1 x will go be in range(0, 100, 10)
---> in which 0 goes until 9 for the 10 subplots.
In plot n.2 x will go be in range(100, 200, 10)
---> in which 100 goes until 109 for the 10 subplots.
In plot n.3 x will go be in range(200, 300, 10)
---> in which 200 goes until 209 for the 10 subplots.
and so on until:
Plot n.10 x will go be in range(900, 1000, 10)
---> in which 900 goes until 909 for the 10 subplots.
fig, ((ax1,ax2, ax3, ax4, ax5), (ax6,ax7, ax8, ax9, ax10)) = plt.subplots(2,5, figsize =(40,20))
axs = [ax1,ax2, ax3, ax4, ax5, ax6,ax7, ax8, ax9, ax10]
for ax in axs:
ax.grid()
ax.set_xlabel('Time [s]', fontsize = 22)
ax.set_ylabel('$C_{vv}(t)$', fontsize = 22)
ax1.title.set_text('$l_0 = 6.00$ $\mu$m')
ax2.title.set_text('$l_0 = 8.67$ $\mu$m')
ax3.title.set_text('$l_0 = 11.33$ $\mu$m')
ax4.title.set_text('$l_0 = 14.00$ $\mu$m')
ax5.title.set_text('$l_0 = 16.67$ $\mu$m')
ax6.title.set_text('$l_0 = 19.33$ $\mu$m')
ax7.title.set_text('$l_0 = 22.00$ $\mu$m')
ax8.title.set_text('$l_0 = 24.67$ $\mu$m')
ax9.title.set_text('$l_0 = 27.33$ $\mu$m')
ax10.title.set_text('$l_0 = 30.00$ $\mu$m')
fig.suptitle('$\lambda = 0.23 $', fontsize = 30)
for x in range(100, 200, 10):
ax1.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(101, 200, 10):
ax2.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(102, 200, 10):
ax3.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(103, 200, 10):
ax4.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(104, 200, 10):
ax5.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(105, 200, 10):
ax6.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(106, 200, 10):
ax7.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(107, 200, 10):
ax8.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(108, 200, 10):
ax9.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=0.5)
for x in range(109, 200, 10):
ax10.plot(VACF[x][:1000,0], VACF[x][:1000,1], alpha=1)
plt.show()
how do I implement and make the code a little bit shorter? Thank you for the help