improved rendering of graphs and matrix