Add write_matrix and write_ticks.