
from pylab import empty, plot, floor, axis, linspace

class mplot:
	def __init__(self, arg1, arg2=None, arg3=None):
		colstr =  'bgrcmyk'
		lencolstr = len(colstr)
		try:
			if arg2.any():
				ai = arg1
				a = arg2
		except:
			a = arg1
			ai = range(a.shape[0])
		myargs = []
		x_vals = arg3
		for i in range(a.shape[1]):
			myargs.append(x_vals)			# NOT always the same x axis vector
			myargs.append(a[:,i])
			#ci = mod(i,lencolstr)   # cannot import mod for some reason
			n = floor(1.0*i/lencolstr)   # equivalent
			ci = int(i - n*lencolstr)    #
			myargs.append(colstr[ci])
			
		plot(*myargs)
