I've set up the following code to read in a .graphml file, preform a calculation (eigenvalues) and then plot the results. Here is the code I have so far:
import numpy as np import networkx as nx import matplotlib.pyplot as plt # Read in the Data G = nx.read_graphml("/home/user/DropBox_External_Datasets/JHU_Human_Brain/cat_brain_1.graphml") nx.draw(G) plt.savefig("test_graph.png") Z = nx.to_numpy_matrix(G) # Get Eigenvalues and Eigenvectors # ---------------------------------------------------------------------------------- # e_vals, e_vec = np.linalg.eigh(Z) print("The eigenvalues of A are:", e_vals) print("The size of the eigenvalues matrix is:", e_vals.shape) # ---------------------------------------------------------------------------------- plt.plot(e_vals, 'g^') plt.ylabel('Eigenvalues') # plt.axis([-30, 300, -15, 30]) # Optimal settings for Rhesus data # plt.axis([-0.07, 1, -0.2, 1.2]) # range to zoom in on cluster of points in Rhesus data plt.grid(b=True, which='major', color='b', linestyle='-') plt.show() But no gridlines or axes show up on the graph. Is there something other then plt.grid() that I need to use?