updating graphs, fixing legend positions