added code to generate global statistics figure