updated plot_matrix to plot real and imag