logging into file, clear fig when fs changed, update graph draw