40
votes

I'm trying to get a bigger chart. However, the figure method from matplotlib does not seem to be working properly.

I get a message, which is not an error:

import pandas.io.data as web
import pandas as pd
import matplotlib.pyplot as plt

%matplotlib inline
...
plt.figure(figsize=(20,10))
df2['media']= df2['SPY']*.6 + df2['TLT']*.4
df2.plot()
plt.show()

What's wrong with my code?

1
Where you able to resolve this after all? - Stefan

1 Answers

94
votes

You can skip the first plt.figure() and just use the argument figsize:

df2.plot(figsize=(20,10))

See docs.