I have followed this solution in order to color-format a matrix on the terminal. However when I print it, the newlines I have added in order to separate the lines of the matrix are not formatted. I expected the whole terminal to become background white and black text (for the area corresponding to the matrix height), but clearly it is not. Why?
This is the code:
m = np.full((4,4),'0',dtype=np.str_)
print('\x1b[0;30;47m\n'+'\n\n'.join(' '+' '.join(line) for line in m)+'\n\x1b[0m')
PROOF:
I am using the default ubuntu 14.04 terminal
SOLVED In the end I simply applied the color-formatting to each string of characters separated by a new line.