plotting and saving data analysis to json format