I have loaded one column each from two different dataframes and am plotting them on a line graph. The graph pops up on my screen, but my plt.savefig command is not working, as no files are saved.
import matplotlib.pyplot as plt
import plotly.plotly as py
import pandas as pd
import plotly.graph_objs as go
# read in LEC
LLEC = pd.read_csv('LLEC_1.csv').transpose()
RLEC = pd.read_csv('RLEC_2.csv').transpose()
#read in DGCA3
LDGCA3=pd.read_csv('LDGCA3_13.csv').transpose()
RDGCA3 = pd.read_csv('RDGCA3_14.csv').transpose()
def plot_betas_left(betaNum):
betaNum = int(betaNum)
#plot betas for both ROIs. start with LEC
ax = LLEC[betaNum].plot()
# add DGCA3
LDGCA3[betaNum].plot(ax=ax)
# label axes
ax.set_xlabel("precise beta number (0 is first)")
ax.set_ylabel("beta coefficient value")
# inset legend
ax.legend(['LEC', 'DGCA3'])
plt.savefig('Subj%s_left_LEC_DGCA3.png' % betaNum+1)
plot_betas(3)