fix a bug in the TSmap, add a script to plot TS map