<filename>files/plotxy.py
# 
# Utility to plot x-y data from CSV file.
#
# Assumes that x-values are in first column
# Plots a curve for each column in addtion to 
# the x-data
#
# Usage:
#    python plotxy.py <CSV input file name> <PNG output file name>
#
import sys
import matplotlib
matplotlib.rcParams['font.size'] = 8
matplotlib.use("Agg")
from matplotlib import pyplot as plt
import numpy as np

# Read CSV data into numpy array
data = np.genfromtxt(sys.argv[1], delimiter=",")

# x-values  are in the first column
xval = data[:,0]

# Get the number of rows
nrow = xval.shape[0]
# Get the number of curves to plot
ncurve = data.shape[1] - 1

fig = plt.figure(1)
ax = plt.subplot(1, 1, 1)
# Loop over curves adding them to the plot
for i in range(ncurve):
   title = "y_" + str(i+1)
   ax.plot(xval[0:], data[0:,i+1], marker="+", label=title)

ax.legend(loc='best', fancybox=True, framealpha=0.5)

fig.savefig(sys.argv[2])


<filename>files/plotxy.py
# 
# Utility to plot x-y data from CSV file.
#
# Assumes that x-values are in first column
# Plots a curve for each column in addtion to 
# the x-data
#
# Usage:
#    python plotxy.py <CSV input file name> <PNG output file name>
#
import sys
import matplotlib
matplotlib.rcParams['font.size'] = 8
matplotlib.use("Agg")
from matplotlib import pyplot as plt
import numpy as np

# Read CSV data into numpy array
data = np.genfromtxt(sys.argv[1], delimiter=",")

# x-values  are in the first column
xval = data[:,0]

# Get the number of rows
nrow = xval.shape[0]
# Get the number of curves to plot
ncurve = data.shape[1] - 1

fig = plt.figure(1)
ax = plt.subplot(1, 1, 1)
# Loop over curves adding them to the plot
for i in range(ncurve):
   title = "y_" + str(i+1)
   ax.plot(xval[0:], data[0:,i+1], marker="+", label=title)

ax.legend(loc='best', fancybox=True, framealpha=0.5)

fig.savefig(sys.argv[2])


# # Utility to plot x-y data from CSV file. # # Assumes that x-values are in first column # Plots a curve for each column in addtion to # the x-data # # Usage: #    python plotxy.py <CSV input file name> <PNG output file name> # # Read CSV data into numpy array # x-values  are in the first column # Get the number of rows # Get the number of curves to plot # Loop over curves adding them to the plot