improved jb_discretize
fix analysis_figure_closed