truncate generate T to prevent segfault caused by overflow

clean up plotting a little