def plot(vector): # by D@CC # on 2021EMay22 # used in testPlot.py # Purpose: print a plot of the vector # ParmIn 01 vector to plot # ParmOut none # vector is a list of values to be plotted # values between 0 and 255 inclusive # the number of values should be less than 64 # Issue 01: python-2 # Issue 02: need to validate the vector # Issue 03: vector must not be complex type samples=vector samples = [1,2,3,4,5,6] #remove in final version to use vlen = len(samples) #actual length -1 vmin = min(samples) vmax = max(samples) ncols = 60 nrows = 10 colThickness = 1 + ncols//vlen (e.g. 10) rowThickness = 1 + nrows//(vmax-vmin) # 2 dim array is shown below matrix = [[0,1,2],[2,4,6]] for i = 0,1: print matrix[i,0], matrix[i,1],matrix[i,2] #for end #end def plot #/plot_py.py.txt