change to use matplotlib