Я внес некоторые изменения в ваш код, и теперь кажется, что я получил то, что вы хотите. Используйте следующий код.
import os
import pandas as pd
import numpy as np
from matplotlib import pyplot
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import re
def makeLinePlot(df):
df2=df
i=0
numRos = df.columns.size
fig,ax =plt.subplots( nrows=1, ncols=numRos,figsize=(30,8))
for index, colName in enumerate(df.columns):
i=i+1
df2[colName]=df2[colName].astype(float)
print(colName,df2[colName].shape)
g=sns.lineplot(x=df2.index, y=df2[colName], ax=ax[index])
colNameR = re.sub('\W+','', colName )
g.get_figure().savefig(colNameR+".png")
range = pd.date_range('2015-01-01', '2015-01-02', freq='1min')
df = pd.DataFrame(index = range)
# Average speed in miles per hour
df['speed'] = np.random.randint(low=0, high=60, size=len(df.index))
# Distance in miles (speed * 0.5 hours)
df['distance'] = df['speed'] * 0.25
# Cumulative distance travelled
df['cumulative_distance'] = df.distance.cumsum()
makeLinePlot(df)
У меня есть это.