I have been facing this issue since nearly two years. I think it has something to do with reading in data within functions that create plots