finally fixed matplotlib bug in photometry