import numpy as np
import matplotlib.pyplot as plt
x1=np.random.normal(0,1,100)
x2=np.random.normal(0,2,100)
d1=pd.Series(x1)
d2=pd.Series(x2)
d1.plot()
d2.plot()
plt.show()
d1=pd.DataFrame(x1)
d2=pd.DataFrame(x2)
d1.plot()
d2.plot()
plt.show()
In the first case (plotting Series objects) the plots are combined, while in the 2nd (same data, but in DataFrame objects) I get two separate plots. Is this intentional? Can I get a bunch of DataFrame plots to combine?
THANKS, Paul
I've noticed a subtle difference between plotting a number of DataFrame objects, vs. plotting a number of Series objects. The DataFrame objects each seem to generate their own plots, while the Series are combined into a single plot. For example, consider the following code:
import pandas as pdimport numpy as np
import matplotlib.pyplot as plt
x1=np.random.normal(0,1,100)
x2=np.random.normal(0,2,100)
d1=pd.Series(x1)
d2=pd.Series(x2)
d1.plot()
d2.plot()
plt.show()
d1=pd.DataFrame(x1)
d2=pd.DataFrame(x2)
d1.plot()
d2.plot()