Skip to content Skip to sidebar Skip to footer

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

  1. create an axes to plot to
  2. run the loop to populate the axes
  3. 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"