I would like to plot a dataframe which has 41 columns in this dataframe so there has 41 charts to plot. I write a script but it loads so slowly. Is there has a solution to optimize this script? Is it possible to use loop function to simplify the list in the zip function?
import matplotlib.pyplot as plt
import pandas as pd
fig,((axs),(axs2),(axs3),(axs4),(axs5),(axs6),(axs7),(axs8),(axs9)) = plt.subplots(9,5,figsize=(15,6))
for ax, y in zip(axs,['XPEV','M','MLCO','VIPS','HD']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs2,['LVS','PTON','SBUX','BLMN','NCLH']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs3,['NIO','NKE','NKLA','NLS','QS']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs4,['AYRO','RMO','TSLA','XL','ASO']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs5,['TOL','VSTO','BABA','FTCH','RIDE']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs6,['EBAY','DS','DKNG','DHI','UAA']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs7,['VFC','TPX','ARVL','GM','GOEV']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs8,['PLBY','CCL','GME','CVNA','LOTZ']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
for ax, y in zip(axs9,['F']):
ax.plot(tickers_data.index.strftime("%d"),tickers_data['Volume',y])
ax.ticklabel_format(style='plain', axis='y')
ax.set_title(y)
plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=1.0)
plt.show()