What is the Python way to create multiple plots?
I've written some code below with plotting variables. My instinct is to write an array of objects to iterate through. It seems like objects in Python are a little more complex than the sort of Javascript/JSON objects I've gotten used to.
Any tips on the 'Python Way' to accomplish what I need to here?
import pandas as pd
import networkx as nx
from networkx.algorithms
import community
import matplotlib.pyplot as plt
from datetime import datetime
graph = pd.read_csv('C:/Users/MYDIR/MYSOURCE.csv')
filename_prefix = datetime.now().strftime("%Y%m%d-%H%M%S")
#begin stuff that changes every plot
filename_suffix = 'suffix_one'
directory = 'C:/Users/MYDIR/';
title='MY_TITLE'
axis1='AXIS1';
axis2='AXIS2';
color = 'lightgreen';
#end stuff that changes every plot
df = graph[[axis1,axis2]]
G = nx.from_pandas_edgelist(df, axis1, axis2 );
plt.figure(figsize=(10,5))
ax = plt.gca()
ax.set_title(title)
nx.draw(G,with_labels=True, node_color=color, ax=ax)
_ = ax.axis('off')
#plt.show()
plt.savefig(directory + filename_prefix +'_' + title);
#plt.savefig(filename_prefix +'_' + filename_suffix + '.png')