Pandas.plot Multiple Plot Same Figure
I have multiple CSV files that I am trying to plot in same the figure to have a comparison between them. I already read some information about pandas problem not keeping memory plo
Solution 1:
The structure is
- create an axes to plot to
- run the loop to populate the axes
- save and/or show (save before show)
In terms of code:
import matplotlib.pyplot as plt
import pandas as pd
ax = plt.gca()
for i inrange (1,10):
df = pd.read_csv(...)
df.plot(..., ax=ax)
df.plot.line(..., ax=ax)
plt.savefig(...)
plt.show()
Post a Comment for "Pandas.plot Multiple Plot Same Figure"