I am new to Stack Overflow and Python as well. I am struggling to find if there is a way to save a plot or figure. Is this possible using this Pandas package? My plot displays ok and I am Python v 2.7.11. Code below and thanks
#pg 73 from Python in Finance
import numpy as np
import pandas as pd
import pandas.io.data as web
sym1 = 'AAPL'
sym2 = 'FB'
symbol1 = web.DataReader(sym1, data_source='yahoo',start='1/1/2015', end='1/28/2016')
symbol2 = web.DataReader(sym2, data_source='yahoo',start='1/1/2015', end='1/28/2016')
ratio = symbol1;
ratio['Close'] = symbol1['Close'] / symbol2['Close'];
#symbol1['Close'].plot(grid=True, figsize=(8, 5))
#symbol2['Close'].plot(grid=True, figsize=(8, 5))
ratio['Close'].plot(grid=True, figsize=(8, 5))
ratio['42d'] = np.round(pd.rolling_mean(ratio['Close'], window=42), 2)
ratio['252d'] = np.round(pd.rolling_mean(ratio['Close'], window=252), 2)
ratio[['Close', '42d', '252d']].plot(grid=True, figsize=(8, 5))