Python Numpy Flatten Array Matlab Plot