Write a matrix_figure function