save figure to file instead of plotting, because pycharm and matplotlib dont work well together